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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame.cc

Issue 8968022: Shell related switches -> aura shell switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/fullscreen_aura.cc ('k') | chrome/browser/ui/views/frame/browser_frame_aura.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/frame/browser_frame.h" 5 #include "chrome/browser/ui/views/frame/browser_frame.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/themes/theme_service.h" 8 #include "chrome/browser/themes/theme_service.h"
9 #include "chrome/browser/themes/theme_service_factory.h" 9 #include "chrome/browser/themes/theme_service_factory.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_list.h" 11 #include "chrome/browser/ui/browser_list.h"
12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
13 #include "chrome/browser/ui/views/frame/browser_root_view.h" 13 #include "chrome/browser/ui/views/frame/browser_root_view.h"
14 #include "chrome/browser/ui/views/frame/browser_view.h" 14 #include "chrome/browser/ui/views/frame/browser_view.h"
15 #include "chrome/browser/ui/views/frame/native_browser_frame.h" 15 #include "chrome/browser/ui/views/frame/native_browser_frame.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "ui/base/theme_provider.h" 17 #include "ui/base/theme_provider.h"
18 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
19 #include "ui/views/widget/native_widget.h" 19 #include "ui/views/widget/native_widget.h"
20 20
21 #if defined(OS_WIN) && !defined(USE_AURA) 21 #if defined(OS_WIN) && !defined(USE_AURA)
22 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" 22 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
23 #elif defined(OS_CHROMEOS) 23 #elif defined(OS_CHROMEOS)
24 #include "chrome/browser/chromeos/system/runtime_environment.h" 24 #include "chrome/browser/chromeos/system/runtime_environment.h"
25 #endif 25 #endif
26 26
27 #if defined(USE_AURA) 27 #if defined(USE_AURA)
28 #include "ui/aura/aura_switches.h" 28 #include "ui/aura_shell/aura_shell_switches.h"
29 #endif 29 #endif
30 30
31 //////////////////////////////////////////////////////////////////////////////// 31 ////////////////////////////////////////////////////////////////////////////////
32 // BrowserFrame, public: 32 // BrowserFrame, public:
33 33
34 BrowserFrame::BrowserFrame(BrowserView* browser_view) 34 BrowserFrame::BrowserFrame(BrowserView* browser_view)
35 : native_browser_frame_(NULL), 35 : native_browser_frame_(NULL),
36 root_view_(NULL), 36 root_view_(NULL),
37 browser_frame_view_(NULL), 37 browser_frame_view_(NULL),
38 browser_view_(browser_view) { 38 browser_view_(browser_view) {
(...skipping 20 matching lines...) Expand all
59 } 59 }
60 if (browser_view_->browser()->is_type_panel()) { 60 if (browser_view_->browser()->is_type_panel()) {
61 // We need to set the top-most bit when the panel window is created. 61 // We need to set the top-most bit when the panel window is created.
62 // There is a Windows bug/feature that would very likely prevent the window 62 // There is a Windows bug/feature that would very likely prevent the window
63 // from being changed to top-most after the window is created without 63 // from being changed to top-most after the window is created without
64 // activation. 64 // activation.
65 params.keep_on_top = true; 65 params.keep_on_top = true;
66 } 66 }
67 #if defined(USE_AURA) 67 #if defined(USE_AURA)
68 CommandLine* command_line = CommandLine::ForCurrentProcess(); 68 CommandLine* command_line = CommandLine::ForCurrentProcess();
69 if (command_line->HasSwitch(switches::kAuraTranslucentFrames)) 69 if (command_line->HasSwitch(aura_shell::switches::kAuraTranslucentFrames))
70 params.transparent = true; 70 params.transparent = true;
71 // Aura laptop mode fills the monitor with with its windows. 71 // Aura laptop mode fills the monitor with with its windows.
72 if (command_line->HasSwitch(switches::kAuraLaptopMode) && 72 if (command_line->HasSwitch(aura_shell::switches::kAuraLaptopMode) &&
73 browser_view_->IsBrowserTypeNormal()) { 73 browser_view_->IsBrowserTypeNormal()) {
74 params.bounds = gfx::Screen::GetPrimaryMonitorBounds(); 74 params.bounds = gfx::Screen::GetPrimaryMonitorBounds();
75 params.show_state = ui::SHOW_STATE_MAXIMIZED; 75 params.show_state = ui::SHOW_STATE_MAXIMIZED;
76 } 76 }
77 #endif 77 #endif
78 Init(params); 78 Init(params);
79 79
80 // On ChromeOS and Aura laptop mode we always want top-level windows 80 // On ChromeOS and Aura laptop mode we always want top-level windows
81 // to appear active. 81 // to appear active.
82 bool disable_inactive_rendering = false; 82 bool disable_inactive_rendering = false;
83 #if defined(USE_AURA) 83 #if defined(USE_AURA)
84 disable_inactive_rendering = 84 disable_inactive_rendering =
85 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraLaptopMode); 85 CommandLine::ForCurrentProcess()->HasSwitch(
86 aura_shell::switches::kAuraLaptopMode);
86 #elif defined(OS_CHROMEOS) 87 #elif defined(OS_CHROMEOS)
87 disable_inactive_rendering = true; 88 disable_inactive_rendering = true;
88 #endif 89 #endif
89 if (disable_inactive_rendering && !browser_view_->IsBrowserTypePopup()) 90 if (disable_inactive_rendering && !browser_view_->IsBrowserTypePopup())
90 DisableInactiveRendering(); 91 DisableInactiveRendering();
91 } 92 }
92 93
93 int BrowserFrame::GetMinimizeButtonOffset() const { 94 int BrowserFrame::GetMinimizeButtonOffset() const {
94 return native_browser_frame_->GetMinimizeButtonOffset(); 95 return native_browser_frame_->GetMinimizeButtonOffset();
95 } 96 }
(...skipping 20 matching lines...) Expand all
116 GetRootView()->child_at(0)->InvalidateLayout(); 117 GetRootView()->child_at(0)->InvalidateLayout();
117 } 118 }
118 GetRootView()->Layout(); 119 GetRootView()->Layout();
119 native_browser_frame_->TabStripDisplayModeChanged(); 120 native_browser_frame_->TabStripDisplayModeChanged();
120 } 121 }
121 122
122 bool BrowserFrame::IsSingleWindowMode() const { 123 bool BrowserFrame::IsSingleWindowMode() const {
123 bool single_window_mode = false; 124 bool single_window_mode = false;
124 #if defined(USE_AURA) 125 #if defined(USE_AURA)
125 single_window_mode = 126 single_window_mode =
126 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraLaptopMode); 127 CommandLine::ForCurrentProcess()->HasSwitch(
128 aura_shell::switches::kAuraLaptopMode);
127 #elif defined(OS_CHROMEOS) 129 #elif defined(OS_CHROMEOS)
128 single_window_mode = 130 single_window_mode =
129 chromeos::system::runtime_environment::IsRunningOnChromeOS(); 131 chromeos::system::runtime_environment::IsRunningOnChromeOS();
130 #endif 132 #endif
131 return single_window_mode; 133 return single_window_mode;
132 } 134 }
133 135
134 /////////////////////////////////////////////////////////////////////////////// 136 ///////////////////////////////////////////////////////////////////////////////
135 // BrowserFrame, views::Widget overrides: 137 // BrowserFrame, views::Widget overrides:
136 138
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // set ourselves as the last active browser window to ensure that we get 184 // set ourselves as the last active browser window to ensure that we get
183 // treated as such by the rest of Chrome. 185 // treated as such by the rest of Chrome.
184 BrowserList::SetLastActive(browser_view_->browser()); 186 BrowserList::SetLastActive(browser_view_->browser());
185 } 187 }
186 Widget::OnNativeWidgetActivationChanged(active); 188 Widget::OnNativeWidgetActivationChanged(active);
187 } 189 }
188 190
189 AvatarMenuButton* BrowserFrame::GetAvatarMenuButton() { 191 AvatarMenuButton* BrowserFrame::GetAvatarMenuButton() {
190 return browser_frame_view_->avatar_button(); 192 return browser_frame_view_->avatar_button();
191 } 193 }
OLDNEW
« no previous file with comments | « chrome/browser/fullscreen_aura.cc ('k') | chrome/browser/ui/views/frame/browser_frame_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698