OLD | NEW |
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/frame/browser_frame.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
35 #include "ash/common/session/session_state_delegate.h" | 35 #include "ash/common/session/session_state_delegate.h" |
36 #include "ash/common/wm_shell.h" | 36 #include "ash/common/wm_shell.h" |
37 #include "ui/native_theme/native_theme_dark_aura.h" | 37 #include "ui/native_theme/native_theme_dark_aura.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_LINUX) | 40 #if defined(OS_LINUX) |
41 #include "chrome/browser/ui/views/frame/browser_command_handler_linux.h" | 41 #include "chrome/browser/ui/views/frame/browser_command_handler_linux.h" |
42 #endif | 42 #endif |
43 | 43 |
| 44 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 45 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
| 46 #endif |
| 47 |
44 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
45 #include "ui/native_theme/native_theme_dark_win.h" | 49 #include "ui/native_theme/native_theme_dark_win.h" |
46 #endif | 50 #endif |
47 | 51 |
48 //////////////////////////////////////////////////////////////////////////////// | 52 //////////////////////////////////////////////////////////////////////////////// |
49 // BrowserFrame, public: | 53 // BrowserFrame, public: |
50 | 54 |
51 BrowserFrame::BrowserFrame(BrowserView* browser_view) | 55 BrowserFrame::BrowserFrame(BrowserView* browser_view) |
52 : native_browser_frame_(nullptr), | 56 : native_browser_frame_(nullptr), |
53 root_view_(nullptr), | 57 root_view_(nullptr), |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // still bring this browser window to the foreground. We explicitly set | 218 // still bring this browser window to the foreground. We explicitly set |
215 // ourselves as the last active browser window to ensure that we get treated | 219 // ourselves as the last active browser window to ensure that we get treated |
216 // as such by the rest of Chrome. | 220 // as such by the rest of Chrome. |
217 BrowserList::SetLastActive(browser_view_->browser()); | 221 BrowserList::SetLastActive(browser_view_->browser()); |
218 } | 222 } |
219 Widget::OnNativeWidgetActivationChanged(active); | 223 Widget::OnNativeWidgetActivationChanged(active); |
220 } | 224 } |
221 | 225 |
222 void BrowserFrame::OnNativeWidgetWorkspaceChanged() { | 226 void BrowserFrame::OnNativeWidgetWorkspaceChanged() { |
223 chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); | 227 chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); |
| 228 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 229 BrowserList::MoveBrowsersInWorkspaceToFront( |
| 230 views::X11DesktopHandler::get()->GetWorkspace()); |
| 231 #endif |
224 Widget::OnNativeWidgetWorkspaceChanged(); | 232 Widget::OnNativeWidgetWorkspaceChanged(); |
225 } | 233 } |
226 | 234 |
227 void BrowserFrame::ShowContextMenuForView(views::View* source, | 235 void BrowserFrame::ShowContextMenuForView(views::View* source, |
228 const gfx::Point& p, | 236 const gfx::Point& p, |
229 ui::MenuSourceType source_type) { | 237 ui::MenuSourceType source_type) { |
230 if (chrome::IsRunningInForcedAppMode()) | 238 if (chrome::IsRunningInForcedAppMode()) |
231 return; | 239 return; |
232 | 240 |
233 // Only show context menu if point is in unobscured parts of browser, i.e. | 241 // Only show context menu if point is in unobscured parts of browser, i.e. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 menu_model_builder_.reset( | 276 menu_model_builder_.reset( |
269 new SystemMenuModelBuilder(browser_view_, browser_view_->browser())); | 277 new SystemMenuModelBuilder(browser_view_, browser_view_->browser())); |
270 menu_model_builder_->Init(); | 278 menu_model_builder_->Init(); |
271 } | 279 } |
272 return menu_model_builder_->menu_model(); | 280 return menu_model_builder_->menu_model(); |
273 } | 281 } |
274 | 282 |
275 views::View* BrowserFrame::GetNewAvatarMenuButton() { | 283 views::View* BrowserFrame::GetNewAvatarMenuButton() { |
276 return browser_frame_view_->GetProfileSwitcherView(); | 284 return browser_frame_view_->GetProfileSwitcherView(); |
277 } | 285 } |
OLD | NEW |