#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 {
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);
};
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) {
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<views::Widget> window_;