Chromium Code Reviews| Index: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| index a43320d43e7f3f6a8dcf42aa40a504154cc59572..00ad9361020d7668e10fdf013f7ddb100503d387 100644 |
| --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| @@ -210,13 +210,7 @@ void ChromeNativeAppWindowViews::InitializeDefaultWindow( |
| views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
| init_params.delegate = this; |
| - init_params.remove_standard_frame = !ShouldUseNativeFrame(); |
| -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| - // On Linux, remove the standard frame. Instead, we will use CustomFrameView |
| - // to draw a native-like frame. |
| - // TODO(mgiuca): Remove this during fix for http://crbug.com/322256. |
| - init_params.remove_standard_frame = true; |
| -#endif |
| + init_params.remove_standard_frame = IsFrameless() || has_frame_color_; |
| init_params.use_system_default_icon = true; |
| // TODO(erg): Conceptually, these are toplevel windows, but we theoretically |
| // could plumb context through to here in some cases. |
| @@ -337,10 +331,6 @@ void ChromeNativeAppWindowViews::InitializePanelWindow( |
| #endif |
| } |
| -bool ChromeNativeAppWindowViews::ShouldUseNativeFrame() const { |
| - return !IsFrameless() && !has_frame_color_; |
| -} |
| - |
| void ChromeNativeAppWindowViews::InstallEasyResizeTargeterOnContainer() const { |
| aura::Window* root_window = widget()->GetNativeWindow()->GetRootWindow(); |
| gfx::Insets inset(kResizeInsideBoundsSize, kResizeInsideBoundsSize, |
| @@ -366,9 +356,11 @@ ChromeNativeAppWindowViews::CreateAppWindowFrameView() { |
| resize_area_corner_size = ash::kResizeAreaCornerSize; |
| } |
| #endif |
| - apps::AppWindowFrameView* frame_view = new apps::AppWindowFrameView(this); |
| + apps::AppWindowFrameView* frame_view = new apps::AppWindowFrameView(); |
| frame_view->Init(widget(), |
| + !IsFrameless() && has_frame_color_, |
|
Matt Giuca
2014/03/27 09:16:27
Note: I simplified the CL a bit (after your review
|
| frame_color_, |
| + GetDraggableRegion(), |
| resize_inside_bounds_size, |
| resize_outside_bounds_size, |
| resize_outside_scale_for_touch, |
| @@ -513,8 +505,12 @@ views::NonClientFrameView* ChromeNativeAppWindowViews::CreateNonClientFrameView( |
| } |
| } |
| #endif |
| - if (!ShouldUseNativeFrame()) |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| + return CreateAppWindowFrameView(); |
| +#else |
| + if (IsFrameless() || has_frame_color_) |
| return CreateAppWindowFrameView(); |
| +#endif |
| return views::WidgetDelegateView::CreateNonClientFrameView(widget); |
| } |
| @@ -672,7 +668,7 @@ void ChromeNativeAppWindowViews::InitializeWindow( |
| NULL)); |
| #if defined(OS_WIN) |
| - if (!ShouldUseNativeFrame() && |
| + if ((IsFrameless() || has_frame_color_) && |
| chrome::GetHostDesktopTypeForNativeWindow(widget()->GetNativeWindow()) != |
| chrome::HOST_DESKTOP_TYPE_ASH) { |
| InstallEasyResizeTargeterOnContainer(); |