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 "ash/shell.h" | |
7 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
8 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
9 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
10 #include "chrome/browser/themes/theme_service_factory.h" | 11 #include "chrome/browser/themes/theme_service_factory.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
13 #include "chrome/browser/ui/browser_window_state.h" | 14 #include "chrome/browser/ui/browser_window_state.h" |
14 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
15 #include "chrome/browser/ui/views/frame/browser_root_view.h" | 16 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
16 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
17 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 18 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "ui/aura/root_window.h" | |
21 #include "ui/aura/window.h" | |
19 #include "ui/base/theme_provider.h" | 22 #include "ui/base/theme_provider.h" |
20 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
21 #include "ui/views/widget/native_widget.h" | 24 #include "ui/views/widget/native_widget.h" |
22 | 25 |
23 #if defined(OS_WIN) && !defined(USE_AURA) | 26 #if defined(OS_WIN) && !defined(USE_AURA) |
24 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" | 27 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
25 #endif | 28 #endif |
26 | 29 |
27 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
28 // BrowserFrame, public: | 31 // BrowserFrame, public: |
(...skipping 25 matching lines...) Expand all Loading... | |
54 ¶ms.bounds, | 57 ¶ms.bounds, |
55 ¶ms.show_state); | 58 ¶ms.show_state); |
56 } | 59 } |
57 if (browser_view_->IsPanel()) { | 60 if (browser_view_->IsPanel()) { |
58 // 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. |
59 // 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 |
60 // 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 |
61 // activation. | 64 // activation. |
62 params.type = views::Widget::InitParams::TYPE_PANEL; | 65 params.type = views::Widget::InitParams::TYPE_PANEL; |
63 } | 66 } |
67 #if defined(USE_ASH) | |
Ben Goodger (Google)
2012/11/12 16:49:33
can we make this USE_AURA?
scottmg
2012/11/12 18:03:53
Done.
scottmg
2012/11/12 18:20:30
Oops, USE_AURA doesn't work on linux_aura. I'm not
Ben Goodger (Google)
2012/11/12 18:26:25
hrm. I guess we're not building ash yet on linux.
| |
68 if (browser_view_->browser()->host_desktop_type() == | |
69 chrome::HOST_DESKTOP_TYPE_ASH) { | |
70 params.context = ash::Shell::GetAllRootWindows()[0]; | |
71 } | |
72 #endif | |
64 Init(params); | 73 Init(params); |
65 | 74 |
66 native_browser_frame_->InitSystemContextMenu(); | 75 native_browser_frame_->InitSystemContextMenu(); |
67 } | 76 } |
68 | 77 |
69 int BrowserFrame::GetMinimizeButtonOffset() const { | 78 int BrowserFrame::GetMinimizeButtonOffset() const { |
70 return native_browser_frame_->GetMinimizeButtonOffset(); | 79 return native_browser_frame_->GetMinimizeButtonOffset(); |
71 } | 80 } |
72 | 81 |
73 gfx::Rect BrowserFrame::GetBoundsForTabStrip(views::View* tabstrip) const { | 82 gfx::Rect BrowserFrame::GetBoundsForTabStrip(views::View* tabstrip) const { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 | 148 |
140 AvatarMenuButton* BrowserFrame::GetAvatarMenuButton() { | 149 AvatarMenuButton* BrowserFrame::GetAvatarMenuButton() { |
141 return browser_frame_view_->avatar_button(); | 150 return browser_frame_view_->avatar_button(); |
142 } | 151 } |
143 | 152 |
144 #if !defined(OS_WIN) || defined(USE_AURA) | 153 #if !defined(OS_WIN) || defined(USE_AURA) |
145 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { | 154 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { |
146 return !IsMaximized(); | 155 return !IsMaximized(); |
147 } | 156 } |
148 #endif // OS_WIN | 157 #endif // OS_WIN |
OLD | NEW |