Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 210363004: Linux: App windows with frame: chrome and no color are now native. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't need not IsFrameless(); that is implied by has_frame_color_. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f3936374750d88f0e610dda428ec423e4b79ccb3 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(),
+ has_frame_color_,
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();
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698