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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h"
7 ////////////////////////////////////////////////////////////////////////////////
8 // BrowserDesktopWindowTreeHostX11, public:
10 BrowserDesktopWindowTreeHostX11::BrowserDesktopWindowTreeHostX11(
11 views::internal::NativeWidgetDelegate
* native_widget_delegate
,
12 views::DesktopNativeWidgetAura
* desktop_native_widget_aura
,
13 BrowserView
* browser_view
)
14 : DesktopWindowTreeHostX11(native_widget_delegate
,
15 desktop_native_widget_aura
),
16 browser_view_(browser_view
) {
19 BrowserDesktopWindowTreeHostX11::~BrowserDesktopWindowTreeHostX11() {
22 ////////////////////////////////////////////////////////////////////////////////
23 // BrowserDesktopWindowTreeHostX11,
24 // BrowserDesktopWindowTreeHost implementation:
26 views::DesktopWindowTreeHost
*
27 BrowserDesktopWindowTreeHostX11::AsDesktopWindowTreeHost() {
31 int BrowserDesktopWindowTreeHostX11::GetMinimizeButtonOffset() const {
35 bool BrowserDesktopWindowTreeHostX11::UsesNativeSystemMenu() const {
39 ////////////////////////////////////////////////////////////////////////////////
40 // BrowserDesktopWindowTreeHostX11,
41 // views::DesktopWindowTreeHostX11 implementation:
43 void BrowserDesktopWindowTreeHostX11::Init(
44 aura::Window
* content_window
,
45 const views::Widget::InitParams
& params
,
46 aura::RootWindow::CreateParams
* rw_create_params
) {
47 views::DesktopWindowTreeHostX11::Init(content_window
, params
,
50 // We have now created our backing X11 window. We now need to (possibly)
51 // alert Unity that there's a menu bar attached to it.
52 global_menu_bar_x11_
.reset(new GlobalMenuBarX11(browser_view_
, this));
55 void BrowserDesktopWindowTreeHostX11::CloseNow() {
56 global_menu_bar_x11_
.reset();
57 DesktopWindowTreeHostX11::CloseNow();
60 ////////////////////////////////////////////////////////////////////////////////
61 // BrowserDesktopWindowTreeHost, public:
64 BrowserDesktopWindowTreeHost
*
65 BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost(
66 views::internal::NativeWidgetDelegate
* native_widget_delegate
,
67 views::DesktopNativeWidgetAura
* desktop_native_widget_aura
,
68 BrowserView
* browser_view
,
69 BrowserFrame
* browser_frame
) {
70 return new BrowserDesktopWindowTreeHostX11(native_widget_delegate
,
71 desktop_native_widget_aura
,