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_desktop_root_window_host_x11.h" | 5 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host_x11.h" |
6 | 6 |
7 //////////////////////////////////////////////////////////////////////////////// | 7 //////////////////////////////////////////////////////////////////////////////// |
8 // BrowserDesktopRootWindowHostX11, public: | 8 // BrowserDesktopRootWindowHostX11, public: |
9 | 9 |
10 BrowserDesktopRootWindowHostX11::BrowserDesktopRootWindowHostX11( | 10 BrowserDesktopRootWindowHostX11::BrowserDesktopRootWindowHostX11( |
11 views::internal::NativeWidgetDelegate* native_widget_delegate, | 11 views::internal::NativeWidgetDelegate* native_widget_delegate, |
12 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 12 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
13 const gfx::Rect& initial_bounds) | 13 const gfx::Rect& initial_bounds, |
| 14 BrowserView* browser_view) |
14 : DesktopRootWindowHostX11(native_widget_delegate, | 15 : DesktopRootWindowHostX11(native_widget_delegate, |
15 desktop_native_widget_aura, | 16 desktop_native_widget_aura, |
16 initial_bounds) { | 17 initial_bounds), |
| 18 browser_view_(browser_view) { |
17 } | 19 } |
18 | 20 |
19 BrowserDesktopRootWindowHostX11::~BrowserDesktopRootWindowHostX11() { | 21 BrowserDesktopRootWindowHostX11::~BrowserDesktopRootWindowHostX11() { |
20 } | 22 } |
21 | 23 |
22 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
23 // BrowserDesktopRootWindowHostX11, | 25 // BrowserDesktopRootWindowHostX11, |
24 // BrowserDesktopRootWindowHost implementation: | 26 // BrowserDesktopRootWindowHost implementation: |
25 | 27 |
26 views::DesktopRootWindowHost* | 28 views::DesktopRootWindowHost* |
27 BrowserDesktopRootWindowHostX11::AsDesktopRootWindowHost() { | 29 BrowserDesktopRootWindowHostX11::AsDesktopRootWindowHost() { |
28 return this; | 30 return this; |
29 } | 31 } |
30 | 32 |
31 int BrowserDesktopRootWindowHostX11::GetMinimizeButtonOffset() const { | 33 int BrowserDesktopRootWindowHostX11::GetMinimizeButtonOffset() const { |
32 return 0; | 34 return 0; |
33 } | 35 } |
34 | 36 |
35 bool BrowserDesktopRootWindowHostX11::UsesNativeSystemMenu() const { | 37 bool BrowserDesktopRootWindowHostX11::UsesNativeSystemMenu() const { |
36 return false; | 38 return false; |
37 } | 39 } |
38 | 40 |
39 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
| 42 // BrowserDesktopRootWindowHostX11, |
| 43 // views::DesktopRootWindowHostX11 implementation: |
| 44 |
| 45 aura::RootWindow* BrowserDesktopRootWindowHostX11::Init( |
| 46 aura::Window* content_window, |
| 47 const views::Widget::InitParams& params) { |
| 48 aura::RootWindow* root_window = views::DesktopRootWindowHostX11::Init( |
| 49 content_window, params); |
| 50 |
| 51 // We have now created our backing X11 window. We now need to (possibly) |
| 52 // alert Unity that there's a menu bar attached to it. |
| 53 global_menu_bar_x11_.reset(new GlobalMenuBarX11(browser_view_, this)); |
| 54 |
| 55 return root_window; |
| 56 } |
| 57 |
| 58 void BrowserDesktopRootWindowHostX11::CloseNow() { |
| 59 global_menu_bar_x11_.reset(); |
| 60 DesktopRootWindowHostX11::CloseNow(); |
| 61 } |
| 62 |
| 63 //////////////////////////////////////////////////////////////////////////////// |
40 // BrowserDesktopRootWindowHost, public: | 64 // BrowserDesktopRootWindowHost, public: |
41 | 65 |
42 // static | 66 // static |
43 BrowserDesktopRootWindowHost* | 67 BrowserDesktopRootWindowHost* |
44 BrowserDesktopRootWindowHost::CreateBrowserDesktopRootWindowHost( | 68 BrowserDesktopRootWindowHost::CreateBrowserDesktopRootWindowHost( |
45 views::internal::NativeWidgetDelegate* native_widget_delegate, | 69 views::internal::NativeWidgetDelegate* native_widget_delegate, |
46 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 70 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
47 const gfx::Rect& initial_bounds, | 71 const gfx::Rect& initial_bounds, |
48 BrowserView* browser_view, | 72 BrowserView* browser_view, |
49 BrowserFrame* browser_frame) { | 73 BrowserFrame* browser_frame) { |
50 return new BrowserDesktopRootWindowHostX11(native_widget_delegate, | 74 return new BrowserDesktopRootWindowHostX11(native_widget_delegate, |
51 desktop_native_widget_aura, | 75 desktop_native_widget_aura, |
52 initial_bounds); | 76 initial_bounds, |
| 77 browser_view); |
53 } | 78 } |
OLD | NEW |