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

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

Issue 7834048: Preliminary work to allow Chrome to build with USE_AURA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/find_bar_host.cc ('k') | chrome/browser/ui/views/frame/browser_view.h » ('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 "views/widget/native_widget.h" 18 #include "views/widget/native_widget.h"
19 19
20 #if defined(OS_WIN) 20 #if defined(OS_WIN) && !defined(USE_AURA)
21 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" 21 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
22 #endif 22 #endif
23 23
24 //////////////////////////////////////////////////////////////////////////////// 24 ////////////////////////////////////////////////////////////////////////////////
25 // BrowserFrame, public: 25 // BrowserFrame, public:
26 26
27 BrowserFrame::BrowserFrame(BrowserView* browser_view) 27 BrowserFrame::BrowserFrame(BrowserView* browser_view)
28 : native_browser_frame_(NULL), 28 : native_browser_frame_(NULL),
29 root_view_(NULL), 29 root_view_(NULL),
30 browser_frame_view_(NULL), 30 browser_frame_view_(NULL),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 #endif 99 #endif
100 return Widget::IsMaximized(); 100 return Widget::IsMaximized();
101 } 101 }
102 102
103 views::internal::RootView* BrowserFrame::CreateRootView() { 103 views::internal::RootView* BrowserFrame::CreateRootView() {
104 root_view_ = new BrowserRootView(browser_view_, this); 104 root_view_ = new BrowserRootView(browser_view_, this);
105 return root_view_; 105 return root_view_;
106 } 106 }
107 107
108 views::NonClientFrameView* BrowserFrame::CreateNonClientFrameView() { 108 views::NonClientFrameView* BrowserFrame::CreateNonClientFrameView() {
109 #if defined(OS_WIN) 109 #if defined(OS_WIN) && !defined(USE_AURA)
110 if (ShouldUseNativeFrame()) { 110 if (ShouldUseNativeFrame()) {
111 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); 111 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_);
112 } else { 112 } else {
113 #endif 113 #endif
114 browser_frame_view_ = 114 browser_frame_view_ =
115 browser::CreateBrowserNonClientFrameView(this, browser_view_); 115 browser::CreateBrowserNonClientFrameView(this, browser_view_);
116 #if defined(OS_WIN) 116 #if defined(OS_WIN) && !defined(USE_AURA)
117 } 117 }
118 #endif 118 #endif
119 return browser_frame_view_; 119 return browser_frame_view_;
120 } 120 }
121 121
122 bool BrowserFrame::GetAccelerator(int command_id, 122 bool BrowserFrame::GetAccelerator(int command_id,
123 ui::Accelerator* accelerator) { 123 ui::Accelerator* accelerator) {
124 return browser_view_->GetAccelerator(command_id, accelerator); 124 return browser_view_->GetAccelerator(command_id, accelerator);
125 } 125 }
126 126
127 ThemeProvider* BrowserFrame::GetThemeProvider() const { 127 ThemeProvider* BrowserFrame::GetThemeProvider() const {
128 return ThemeServiceFactory::GetForProfile( 128 return ThemeServiceFactory::GetForProfile(
129 browser_view_->browser()->profile()); 129 browser_view_->browser()->profile());
130 } 130 }
131 131
132 void BrowserFrame::OnNativeWidgetActivationChanged(bool active) { 132 void BrowserFrame::OnNativeWidgetActivationChanged(bool active) {
133 if (active) { 133 if (active) {
134 // When running under remote desktop, if the remote desktop client is not 134 // When running under remote desktop, if the remote desktop client is not
135 // active on the users desktop, then none of the windows contained in the 135 // active on the users desktop, then none of the windows contained in the
136 // remote desktop will be activated. However, NativeWidgetWin::Activate() 136 // remote desktop will be activated. However, NativeWidgetWin::Activate()
137 // will still bring this browser window to the foreground. We explicitly 137 // will still bring this browser window to the foreground. We explicitly
138 // set ourselves as the last active browser window to ensure that we get 138 // set ourselves as the last active browser window to ensure that we get
139 // treated as such by the rest of Chrome. 139 // treated as such by the rest of Chrome.
140 BrowserList::SetLastActive(browser_view_->browser()); 140 BrowserList::SetLastActive(browser_view_->browser());
141 } 141 }
142 Widget::OnNativeWidgetActivationChanged(active); 142 Widget::OnNativeWidgetActivationChanged(active);
143 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_host.cc ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698