diff --git a/browser/native_window_win.cc b/browser/native_window_win.cc index ff42210013f0..0a84afd4d731 100644 --- a/browser/native_window_win.cc +++ b/browser/native_window_win.cc @@ -11,6 +11,7 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/widget/widget.h" #include "ui/views/window/client_view.h" +#include "ui/views/window/native_frame_view.h" namespace atom { @@ -33,6 +34,30 @@ class NativeWindowClientView : public views::ClientView { private: NativeWindowWin* shell_; + + DISALLOW_COPY_AND_ASSIGN(NativeWindowClientView); +}; + +class NativeWindowFrameView : public views::NativeFrameView { + public: + explicit NativeWindowFrameView(views::Widget* frame, NativeWindowWin* shell) + : NativeFrameView(frame), + shell_(shell) { + } + virtual ~NativeWindowFrameView() {} + + virtual gfx::Size GetMinimumSize() OVERRIDE { + return shell_->GetMinimumSize(); + } + + virtual gfx::Size GetMaximumSize() OVERRIDE { + return shell_->GetMaximumSize(); + } + + private: + NativeWindowWin* shell_; + + DISALLOW_COPY_AND_ASSIGN(NativeWindowFrameView); }; @@ -237,6 +262,11 @@ views::ClientView* NativeWindowWin::CreateClientView(views::Widget* widget) { return new NativeWindowClientView(widget, web_view_, this); } +views::NonClientFrameView* NativeWindowWin::CreateNonClientFrameView( + views::Widget* widget) { + return new NativeWindowFrameView(widget, this); +} + // static NativeWindow* NativeWindow::Create(content::WebContents* web_contents, base::DictionaryValue* options) { diff --git a/browser/native_window_win.h b/browser/native_window_win.h index 22c6d35adb40..3d09615e59fe 100644 --- a/browser/native_window_win.h +++ b/browser/native_window_win.h @@ -75,6 +75,8 @@ class NativeWindowWin : public NativeWindow, virtual views::Widget* GetWidget() OVERRIDE; virtual const views::Widget* GetWidget() const OVERRIDE; virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE; + virtual views::NonClientFrameView* CreateNonClientFrameView( + views::Widget* widget) OVERRIDE; private: scoped_ptr window_;