diff options
6 files changed, 25 insertions, 20 deletions
diff --git a/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views.cc b/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views.cc index d3d5099..4af6578 100644 --- a/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views.cc +++ b/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views.cc @@ -10,5 +10,7 @@ apps::NativeAppWindow* ChromeShellWindowDelegate::CreateNativeAppWindowImpl( apps::ShellWindow* shell_window, const apps::ShellWindow::CreateParams& params) { - return new NativeAppWindowViews(shell_window, params); + NativeAppWindowViews* window = new NativeAppWindowViews; + window->Init(shell_window, params); + return window; } diff --git a/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views_win.cc b/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views_win.cc index 6eabae0..9ef69f3 100644 --- a/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views_win.cc +++ b/chrome/browser/ui/views/apps/chrome_shell_window_delegate_views_win.cc @@ -10,5 +10,7 @@ apps::NativeAppWindow* ChromeShellWindowDelegate::CreateNativeAppWindowImpl( apps::ShellWindow* shell_window, const apps::ShellWindow::CreateParams& params) { - return new NativeAppWindowViewsWin(shell_window, params); + NativeAppWindowViewsWin* window = new NativeAppWindowViewsWin; + window->Init(shell_window, params); + return window; } diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc index 32e0457..2cc7740 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc @@ -206,17 +206,20 @@ class NativeAppWindowStateDelegate : public ash::wm::WindowStateDelegate, } // namespace -NativeAppWindowViews::NativeAppWindowViews( - ShellWindow* shell_window, - const ShellWindow::CreateParams& create_params) - : shell_window_(shell_window), - web_view_(NULL), +NativeAppWindowViews::NativeAppWindowViews() + : web_view_(NULL), window_(NULL), is_fullscreen_(false), - frameless_(create_params.frame == ShellWindow::FRAME_NONE), - transparent_background_(create_params.transparent_background), - resizable_(create_params.resizable), weak_ptr_factory_(this) { +} + +void NativeAppWindowViews::Init( + apps::ShellWindow* shell_window, + const ShellWindow::CreateParams& create_params) { + shell_window_ = shell_window; + frameless_ = create_params.frame == ShellWindow::FRAME_NONE; + transparent_background_ = create_params.transparent_background; + resizable_ = create_params.resizable; Observe(web_contents()); window_ = new views::Widget; diff --git a/chrome/browser/ui/views/apps/native_app_window_views.h b/chrome/browser/ui/views/apps/native_app_window_views.h index 4c4338b..f2ce0cb 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.h +++ b/chrome/browser/ui/views/apps/native_app_window_views.h @@ -59,9 +59,10 @@ class NativeAppWindowViews : public apps::NativeAppWindow, public views::WidgetDelegateView, public views::WidgetObserver { public: - NativeAppWindowViews(apps::ShellWindow* shell_window, - const apps::ShellWindow::CreateParams& params); + NativeAppWindowViews(); virtual ~NativeAppWindowViews(); + void Init(apps::ShellWindow* shell_window, + const apps::ShellWindow::CreateParams& create_params); protected: // Called before views::Widget::Init() to allow subclasses to customize @@ -211,8 +212,8 @@ class NativeAppWindowViews : public apps::NativeAppWindow, scoped_ptr<SkRegion> draggable_region_; - const bool frameless_; - const bool transparent_background_; + bool frameless_; + bool transparent_background_; gfx::Size preferred_size_; bool resizable_; diff --git a/chrome/browser/ui/views/apps/native_app_window_views_win.cc b/chrome/browser/ui/views/apps/native_app_window_views_win.cc index b4d7f6e..00ea974 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views_win.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views_win.cc @@ -13,10 +13,8 @@ #include "ui/aura/remote_root_window_host_win.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" -NativeAppWindowViewsWin::NativeAppWindowViewsWin( - apps::ShellWindow* shell_window, - const apps::ShellWindow::CreateParams& params) - : NativeAppWindowViews(shell_window, params) {} +NativeAppWindowViewsWin::NativeAppWindowViewsWin() { +} void NativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() { if (!ash::Shell::HasInstance()) diff --git a/chrome/browser/ui/views/apps/native_app_window_views_win.h b/chrome/browser/ui/views/apps/native_app_window_views_win.h index 315c7f6..17ec749 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views_win.h +++ b/chrome/browser/ui/views/apps/native_app_window_views_win.h @@ -11,8 +11,7 @@ // for packaged apps. class NativeAppWindowViewsWin : public NativeAppWindowViews { public: - NativeAppWindowViewsWin(apps::ShellWindow* shell_window, - const apps::ShellWindow::CreateParams& params); + NativeAppWindowViewsWin(); private: void ActivateParentDesktopIfNecessary(); |