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

Unified Diff: chrome/browser/ui/views/window.cc

Issue 9618022: Ash: Use translucent frames by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leak in CustomFrameViewAsh Created 8 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/frame/browser_non_client_frame_view_factory_aura.cc ('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/window.cc
diff --git a/chrome/browser/ui/views/window.cc b/chrome/browser/ui/views/window.cc
index d3b0e561b988163014121d08bc3a7c7a9af70c4c..d4d8daa7c324d8d2f8ec7c706c42fbee58823234 100644
--- a/chrome/browser/ui/views/window.cc
+++ b/chrome/browser/ui/views/window.cc
@@ -8,8 +8,10 @@
#include "ui/views/widget/widget.h"
#if defined(USE_AURA)
+#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
+#include "base/command_line.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#endif
@@ -33,6 +35,33 @@
// The remainder of the code here is dealing with the legacy CrOS WM and
// can also be removed.
+namespace {
+
+views::Widget* CreateViewsWindowWithParent(gfx::NativeWindow parent,
+ views::WidgetDelegate* delegate) {
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params;
+ params.delegate = delegate;
+#if defined(OS_WIN) || defined(USE_AURA)
+ params.parent = parent;
+#endif
+#if defined(USE_AURA)
+ // Outside of compact mode, dialog windows may have translucent frames.
+ // TODO(jamescook): Find a better way to set this.
+ CommandLine* cmd = CommandLine::ForCurrentProcess();
+ bool compact_window_mode =
+ cmd->HasSwitch(ash::switches::kAuraForceCompactWindowMode) ||
+ cmd->GetSwitchValueASCII(ash::switches::kAuraWindowMode) ==
+ ash::switches::kAuraWindowModeCompact;
+ if (!compact_window_mode)
+ params.transparent = true;
+#endif
+ widget->Init(params);
+ return widget;
+}
+
+} // namespace
+
namespace browser {
views::Widget* CreateViewsWindow(gfx::NativeWindow parent,
@@ -41,7 +70,7 @@ views::Widget* CreateViewsWindow(gfx::NativeWindow parent,
#if defined(OS_CHROMEOS) && !defined(USE_AURA)
return chromeos::BubbleWindow::Create(parent, style, delegate);
#else
- return views::Widget::CreateWindowWithParent(delegate, parent);
+ return CreateViewsWindowWithParent(parent, delegate);
#endif
}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698