Chromium Code Reviews| Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| index 2c7ef56f99b2853cec2ce618919597a3e73affff..78904dceffe2404d32e2147c5ae3ca3c1ccfee82 100644 |
| --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| @@ -6,6 +6,7 @@ |
| #include "apps/app_window.h" |
| #include "apps/app_window_registry.h" |
| +#include "apps/ui/views/app_window_frame_view.h" |
| #include "ash/shell.h" |
| #include "base/command_line.h" |
| #include "base/file_util.h" |
| @@ -18,6 +19,9 @@ |
| #include "chrome/browser/metro_utils/metro_chrome_win.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/shell_integration.h" |
| +#include "chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h" |
| +#include "chrome/browser/ui/views/apps/glass_app_window_frame_view.h" |
| +#include "chrome/browser/ui/web_applications/web_app_ui.h" |
|
benwells
2014/04/04 06:50:43
This was a rebase error...
|
| #include "chrome/browser/web_applications/web_app.h" |
| #include "chrome/browser/web_applications/web_app_win.h" |
| #include "chrome/common/chrome_icon_resources_win.h" |
| @@ -30,6 +34,11 @@ |
| #include "ui/base/win/shell.h" |
| #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| #include "ui/views/win/hwnd_util.h" |
| +#include "ui/wm/core/easy_resize_window_targeter.h" |
| + |
| +#if defined(USE_ASH) |
| +#include "chrome/browser/ui/ash/ash_util.h" |
| +#endif |
| namespace { |
| @@ -68,7 +77,7 @@ void CreateIconAndSetRelaunchDetails( |
| } // namespace |
| ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin() |
| - : weak_ptr_factory_(this) {} |
| + : weak_ptr_factory_(this), glass_frame_view_(NULL) {} |
| void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() { |
| if (!ash::Shell::HasInstance()) |
| @@ -140,7 +149,7 @@ void ChromeNativeAppWindowViewsWin::OnBeforeWidgetInit( |
| if (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) |
| init_params->context = ash::Shell::GetPrimaryRootWindow(); |
| else |
| - init_params->native_widget = new views::DesktopNativeWidgetAura(widget); |
| + init_params->native_widget = new AppWindowDesktopNativeWidgetAuraWin(this); |
| } |
| void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow( |
| @@ -168,6 +177,33 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow( |
| UpdateShelfMenu(); |
| } |
| +views::NonClientFrameView* |
| +ChromeNativeAppWindowViewsWin::CreateStandardAppWindowFrame() { |
| + glass_frame_view_ = NULL; |
| + if (ui::win::IsAeroGlassEnabled()) { |
| + glass_frame_view_ = new apps::GlassAppWindowFrameView(this, widget()); |
| + return glass_frame_view_; |
| + } |
| + return ChromeNativeAppWindowViews::CreateStandardAppWindowFrame(); |
| +} |
| + |
| +apps::AppWindowFrameView* |
| +ChromeNativeAppWindowViewsWin::CreateNonStandardAppWindowFrame() { |
| + apps::AppWindowFrameView* frame = |
| + ChromeNativeAppWindowViews::CreateNonStandardAppWindowFrame(); |
| + |
| + if (!chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) { |
| + aura::Window* root_window = widget()->GetNativeWindow()->GetRootWindow(); |
| + int resize_inside = frame->resize_inside_bounds_size(); |
| + gfx::Insets inset( |
| + resize_inside, resize_inside, resize_inside, resize_inside); |
| + root_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| + new wm::EasyResizeWindowTargeter(root_window, inset, inset))); |
| + } |
| + |
| + return frame; |
| +} |
| + |
| void ChromeNativeAppWindowViewsWin::Show() { |
| ActivateParentDesktopIfNecessary(); |
| ChromeNativeAppWindowViews::Show(); |