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

Unified Diff: ui/views/widget/widget.cc

Issue 108193005: Fixing opacity for browser frame window on ASH/Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified definition for UseTransparentWindows as per code review discussion. Created 7 years 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 | « ui/views/views_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 469d4560cb06353f9ea949640ce58162ccc78318..c3406993b99815e73fa06b10d4fc71dc39cfc9ba 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -112,9 +112,7 @@ Widget::InitParams::InitParams()
: type(TYPE_WINDOW),
delegate(NULL),
child(false),
- opacity((ViewsDelegate::views_delegate &&
- ViewsDelegate::views_delegate->UseTransparentWindows()) ?
- TRANSLUCENT_WINDOW : INFER_OPACITY),
+ opacity(INFER_OPACITY),
accept_events(true),
can_activate(true),
keep_on_top(false),
@@ -137,10 +135,7 @@ Widget::InitParams::InitParams(Type type)
: type(type),
delegate(NULL),
child(type == TYPE_CONTROL),
- opacity(((type == TYPE_WINDOW || type == TYPE_PANEL) &&
- ViewsDelegate::views_delegate &&
- ViewsDelegate::views_delegate->UseTransparentWindows()) ?
- TRANSLUCENT_WINDOW : INFER_OPACITY),
+ opacity(INFER_OPACITY),
accept_events(true),
can_activate(type != TYPE_POPUP && type != TYPE_MENU &&
type != TYPE_DRAG),
@@ -349,17 +344,13 @@ void Widget::Init(const InitParams& in_params) {
params.type != InitParams::TYPE_CONTROL &&
params.type != InitParams::TYPE_TOOLTIP);
params.top_level = is_top_level_;
+
if (params.opacity == InitParams::INFER_OPACITY) {
-#if defined(OS_WIN) && defined(USE_AURA)
- // By default, make all top-level windows but the main window transparent
- // initially so that they can be made to fade in.
- if (is_top_level_ && params.type != InitParams::TYPE_WINDOW)
+ if (ViewsDelegate::views_delegate &&
+ ViewsDelegate::views_delegate->UseTransparentWindows(&params))
params.opacity = InitParams::TRANSLUCENT_WINDOW;
else
params.opacity = InitParams::OPAQUE_WINDOW;
-#else
- params.opacity = InitParams::OPAQUE_WINDOW;
-#endif
}
if (ViewsDelegate::views_delegate)
« no previous file with comments | « ui/views/views_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698