💄 NativeWindowClientView no longer needs a extra content view.

This commit is contained in:
Cheng Zhao 2013-10-04 09:04:32 +08:00
parent 4e2d3f3d12
commit ae98d9c8b6

View file

@ -61,21 +61,17 @@ class MenuCommandNativeWidget : public views::NativeWidgetWin {
class NativeWindowClientView : public views::ClientView { class NativeWindowClientView : public views::ClientView {
public: public:
NativeWindowClientView(views::Widget* widget, NativeWindowClientView(views::Widget* widget,
views::View* contents_view, NativeWindowWin* contents_view)
NativeWindowWin* shell) : views::ClientView(widget, contents_view) {
: views::ClientView(widget, contents_view),
shell_(shell) {
} }
virtual ~NativeWindowClientView() {} virtual ~NativeWindowClientView() {}
virtual bool CanClose() OVERRIDE { virtual bool CanClose() OVERRIDE {
shell_->CloseWebContents(); static_cast<NativeWindowWin*>(contents_view())->CloseWebContents();
return false; return false;
} }
private: private:
NativeWindowWin* shell_;
DISALLOW_COPY_AND_ASSIGN(NativeWindowClientView); DISALLOW_COPY_AND_ASSIGN(NativeWindowClientView);
}; };
@ -447,7 +443,7 @@ const views::Widget* NativeWindowWin::GetWidget() const {
} }
views::ClientView* NativeWindowWin::CreateClientView(views::Widget* widget) { views::ClientView* NativeWindowWin::CreateClientView(views::Widget* widget) {
return new NativeWindowClientView(widget, this, this); return new NativeWindowClientView(widget, this);
} }
views::NonClientFrameView* NativeWindowWin::CreateNonClientFrameView( views::NonClientFrameView* NativeWindowWin::CreateNonClientFrameView(