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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/window.h" 5 #include "chrome/browser/ui/views/window.h"
6 6
7 #include "ui/views/bubble/bubble_delegate.h" 7 #include "ui/views/bubble/bubble_delegate.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 #if defined(USE_AURA) 10 #if defined(USE_AURA)
(...skipping 15 matching lines...) Expand all
26 26
27 // Note: This file should be removed after the old ChromeOS frontend is removed. 27 // Note: This file should be removed after the old ChromeOS frontend is removed.
28 // It is not needed for Aura. 28 // It is not needed for Aura.
29 // The visual style implemented by BubbleFrameView/BubbleWindow for 29 // The visual style implemented by BubbleFrameView/BubbleWindow for
30 // ChromeOS should move to Ash. 30 // ChromeOS should move to Ash.
31 // Calling code should just call the standard views Widget creation 31 // Calling code should just call the standard views Widget creation
32 // methods and "the right thing" should just happen. 32 // methods and "the right thing" should just happen.
33 // The remainder of the code here is dealing with the legacy CrOS WM and 33 // The remainder of the code here is dealing with the legacy CrOS WM and
34 // can also be removed. 34 // can also be removed.
35 35
36 namespace {
37
38 views::Widget* CreateViewsWindowWithParent(gfx::NativeWindow parent,
39 views::WidgetDelegate* delegate) {
40 views::Widget* widget = new views::Widget;
41 views::Widget::InitParams params;
42 params.delegate = delegate;
43 #if defined(OS_WIN) || defined(USE_AURA)
44 params.parent = parent;
45 #endif
46 #if defined(USE_AURA)
47 // Outside of compact mode, dialog windows may have translucent frames.
Ben Goodger (Google) 2012/03/06 21:14:19 Can you add a TODO to find a better way to set thi
James Cook 2012/03/06 21:48:16 Done.
48 if (!ash::Shell::GetInstance()->IsWindowModeCompact())
49 params.transparent = true;
50 #endif
51 widget->Init(params);
52 return widget;
53 }
54
55 } // namespace
56
36 namespace browser { 57 namespace browser {
37 58
38 views::Widget* CreateViewsWindow(gfx::NativeWindow parent, 59 views::Widget* CreateViewsWindow(gfx::NativeWindow parent,
39 views::WidgetDelegate* delegate, 60 views::WidgetDelegate* delegate,
40 DialogStyle style) { 61 DialogStyle style) {
41 #if defined(OS_CHROMEOS) && !defined(USE_AURA) 62 #if defined(OS_CHROMEOS) && !defined(USE_AURA)
42 return chromeos::BubbleWindow::Create(parent, style, delegate); 63 return chromeos::BubbleWindow::Create(parent, style, delegate);
43 #else 64 #else
44 return views::Widget::CreateWindowWithParent(delegate, parent); 65 return CreateViewsWindowWithParent(parent, delegate);
45 #endif 66 #endif
46 } 67 }
47 68
48 views::Widget* CreateFramelessViewsWindow(gfx::NativeWindow parent, 69 views::Widget* CreateFramelessViewsWindow(gfx::NativeWindow parent,
49 views::WidgetDelegate* delegate) { 70 views::WidgetDelegate* delegate) {
50 #if defined(OS_CHROMEOS) && !defined(USE_AURA) 71 #if defined(OS_CHROMEOS) && !defined(USE_AURA)
51 return chromeos::BubbleWindow::Create(parent, STYLE_FLUSH, delegate); 72 return chromeos::BubbleWindow::Create(parent, STYLE_FLUSH, delegate);
52 #else 73 #else
53 return CreateFramelessWindowWithParentAndBounds(delegate, 74 return CreateFramelessWindowWithParentAndBounds(delegate,
54 parent, gfx::Rect()); 75 parent, gfx::Rect());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 params.push_back(1); // Show while screen is locked. 123 params.push_back(1); // Show while screen is locked.
103 chromeos::WmIpc::instance()->SetWindowType( 124 chromeos::WmIpc::instance()->SetWindowType(
104 bubble_widget->GetNativeView(), 125 bubble_widget->GetNativeView(),
105 chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE, 126 chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE,
106 &params); 127 &params);
107 #endif 128 #endif
108 return bubble_widget; 129 return bubble_widget;
109 } 130 }
110 131
111 } // namespace browser 132 } // namespace browser
OLDNEW
« 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