Index: chrome/browser/ui/views/apps/native_app_window_views.cc |
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 b835356a10fe1851ee6e4cad8874e5a104ab057b..3d3a12bbd0a369b72d04e17cf8d7871745dd6ce3 100644 |
--- a/chrome/browser/ui/views/apps/native_app_window_views.cc |
+++ b/chrome/browser/ui/views/apps/native_app_window_views.cc |
@@ -210,6 +210,8 @@ void NativeAppWindowViews::Init(apps::AppWindow* app_window, |
const AppWindow::CreateParams& create_params) { |
app_window_ = app_window; |
frameless_ = create_params.frame == AppWindow::FRAME_NONE; |
+ has_frame_color_ = create_params.has_frame_color; |
+ frame_color_ = create_params.frame_color; |
transparent_background_ = create_params.transparent_background; |
resizable_ = create_params.resizable; |
Observe(web_contents()); |
@@ -246,7 +248,7 @@ void NativeAppWindowViews::InitializeDefaultWindow( |
views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
init_params.delegate = this; |
- init_params.remove_standard_frame = ShouldUseChromeStyleFrame(); |
+ 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. |
@@ -367,17 +369,8 @@ void NativeAppWindowViews::InitializePanelWindow( |
#endif |
} |
-bool NativeAppWindowViews::ShouldUseChromeStyleFrame() const { |
- if (frameless_) |
- return true; |
- |
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
- // Linux always uses native style frames. |
- return false; |
-#endif |
- |
- return !CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAppsUseNativeFrame); |
+bool NativeAppWindowViews::ShouldUseNativeFrame() const { |
+ return !frameless_ & !has_frame_color_; |
} |
apps::AppWindowFrameView* NativeAppWindowViews::CreateAppWindowFrameView() { |
@@ -398,6 +391,7 @@ apps::AppWindowFrameView* NativeAppWindowViews::CreateAppWindowFrameView() { |
#endif |
apps::AppWindowFrameView* frame_view = new apps::AppWindowFrameView(this); |
frame_view->Init(window_, |
+ frame_color_, |
resize_inside_bounds_size, |
resize_outside_bounds_size, |
resize_outside_scale_for_touch, |
@@ -621,7 +615,7 @@ bool NativeAppWindowViews::CanMaximize() const { |
} |
base::string16 NativeAppWindowViews::GetWindowTitle() const { |
- return app_window_->GetTitle(); |
+ return base::string16(); |
} |
bool NativeAppWindowViews::ShouldShowWindowTitle() const { |
@@ -713,7 +707,7 @@ views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView( |
} |
} |
#endif |
- if (ShouldUseChromeStyleFrame()) |
+ if (!ShouldUseNativeFrame()) |
return CreateAppWindowFrameView(); |
return views::WidgetDelegateView::CreateNonClientFrameView(widget); |
} |
@@ -955,6 +949,10 @@ bool NativeAppWindowViews::IsFrameless() const { |
return frameless_; |
} |
+bool NativeAppWindowViews::HasFrameColor() const { return has_frame_color_; } |
+ |
+SkColor NativeAppWindowViews::FrameColor() const { return frame_color_; } |
+ |
gfx::Insets NativeAppWindowViews::GetFrameInsets() const { |
if (frameless_) |
return gfx::Insets(); |