1 // Copyright 2015 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 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_AURA_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_AURA_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
10 #include "ui/views/context_menu_controller.h"
13 class AppWindowFrameView
;
17 class ImmersiveFullscreenController
;
24 // Aura-specific parts of ChromeNativeAppWindowViews. This is used on Linux,
25 // CrOS, and Windows and implies USE_ASH.
26 class ChromeNativeAppWindowViewsAura
: public ChromeNativeAppWindowViews
,
27 public views::ContextMenuController
{
29 ChromeNativeAppWindowViewsAura();
30 ~ChromeNativeAppWindowViewsAura() override
;
33 // NativeAppWindowViews implementation.
34 void InitializeWindow(
35 extensions::AppWindow
* app_window
,
36 const extensions::AppWindow::CreateParams
& create_params
) override
;
38 // ChromeNativeAppWindowViews implementation.
39 void OnBeforeWidgetInit(
40 const extensions::AppWindow::CreateParams
& create_params
,
41 views::Widget::InitParams
* init_params
,
42 views::Widget
* widget
) override
;
43 void OnBeforePanelWidgetInit(bool use_default_bounds
,
44 views::Widget::InitParams
* init_params
,
45 views::Widget
* widget
) override
;
46 views::NonClientFrameView
* CreateNonStandardAppFrame() override
;
48 // ui::BaseWindow implementation.
49 gfx::Rect
GetRestoredBounds() const override
;
50 ui::WindowShowState
GetRestoredState() const override
;
51 bool IsAlwaysOnTop() const override
;
53 // views::ContextMenuController implementation.
54 void ShowContextMenuForView(views::View
* source
,
56 ui::MenuSourceType source_type
) override
;
58 // WidgetDelegate implementation.
59 views::NonClientFrameView
* CreateNonClientFrameView(
60 views::Widget
* widget
) override
;
62 // NativeAppWindow implementation.
63 void SetFullscreen(int fullscreen_types
) override
;
64 void UpdateShape(scoped_ptr
<SkRegion
> region
) override
;
67 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest
,
68 ResizeInsetsWithinBounds
);
70 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In
71 // immersive fullscreen, the window header (title bar and window controls)
72 // slides onscreen as an overlay when the mouse is hovered at the top of the
74 scoped_ptr
<ash::ImmersiveFullscreenController
>
75 immersive_fullscreen_controller_
;
77 #if defined(OS_CHROMEOS)
78 // Used to show the system menu.
79 scoped_ptr
<views::MenuRunner
> menu_runner_
;
82 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViewsAura
);
85 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_AURA_H_