Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.h

Issue 947343003: Split out Ash/Aura parts of ChromeNativeAppWindowViews. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "extensions/components/native_app_window/native_app_window_views.h" 9 #include "extensions/components/native_app_window/native_app_window_views.h"
10 #include "ui/views/context_menu_controller.h"
11 10
12 namespace apps { 11 namespace apps {
13 class AppWindowFrameView; 12 class AppWindowFrameView;
14 } 13 }
15 14
16 #if defined(USE_ASH)
17 namespace ash {
18 class ImmersiveFullscreenController;
19 }
20 #endif
21
22 class DesktopKeyboardCapture; 15 class DesktopKeyboardCapture;
23 class ExtensionKeybindingRegistryViews; 16 class ExtensionKeybindingRegistryViews;
24 17
25 namespace views {
26 class MenuRunner;
27 }
28
29 class ChromeNativeAppWindowViews 18 class ChromeNativeAppWindowViews
30 : public native_app_window::NativeAppWindowViews, 19 : public native_app_window::NativeAppWindowViews {
31 public views::ContextMenuController {
32 public: 20 public:
33 ChromeNativeAppWindowViews(); 21 ChromeNativeAppWindowViews();
34 ~ChromeNativeAppWindowViews() override; 22 ~ChromeNativeAppWindowViews() override;
35 23
36 SkRegion* shape() { return shape_.get(); } 24 SkRegion* shape() { return shape_.get(); }
37 25
38 protected: 26 protected:
39 // Called before views::Widget::Init() to allow subclasses to customize 27 // Called before views::Widget::Init() to allow subclasses to customize
40 // the InitParams that would be passed. 28 // the InitParams that would be passed.
41 virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params, 29 virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params,
42 views::Widget* widget); 30 views::Widget* widget);
43 31
44 virtual void InitializeDefaultWindow( 32 virtual void InitializeDefaultWindow(
45 const extensions::AppWindow::CreateParams& create_params); 33 const extensions::AppWindow::CreateParams& create_params);
34 virtual gfx::NativeView GetImeWindowContainer();
46 virtual void InitializePanelWindow( 35 virtual void InitializePanelWindow(
tapted 2015/02/25 05:54:35 nit: keep this with InitializeDefaultWindow
jackhou1 2015/02/25 22:57:51 Done.
47 const extensions::AppWindow::CreateParams& create_params); 36 const extensions::AppWindow::CreateParams& create_params);
37 virtual gfx::Rect GetPanelWindowInitialBounds(gfx::Size preferred_size_);
tapted 2015/02/25 05:54:35 const gfx::Size& preferred_size
jackhou1 2015/02/25 22:57:51 Done.
48 virtual views::NonClientFrameView* CreateStandardDesktopAppFrame(); 38 virtual views::NonClientFrameView* CreateStandardDesktopAppFrame();
39 virtual apps::AppWindowFrameView* CreateNonStandardAppFrame();
49 40
50 // ui::BaseWindow implementation. 41 // ui::BaseWindow implementation.
51 gfx::Rect GetRestoredBounds() const override; 42 gfx::Rect GetRestoredBounds() const override;
52 ui::WindowShowState GetRestoredState() const override; 43 ui::WindowShowState GetRestoredState() const override;
53 bool IsAlwaysOnTop() const override; 44 bool IsAlwaysOnTop() const override;
54 45
55 // Overridden from views::ContextMenuController:
56 void ShowContextMenuForView(views::View* source,
57 const gfx::Point& p,
58 ui::MenuSourceType source_type) override;
59
60 // WidgetDelegate implementation. 46 // WidgetDelegate implementation.
61 gfx::ImageSkia GetWindowAppIcon() override; 47 gfx::ImageSkia GetWindowAppIcon() override;
62 gfx::ImageSkia GetWindowIcon() override; 48 gfx::ImageSkia GetWindowIcon() override;
63 views::NonClientFrameView* CreateNonClientFrameView( 49 views::NonClientFrameView* CreateNonClientFrameView(
64 views::Widget* widget) override; 50 views::Widget* widget) override;
65 bool WidgetHasHitTestMask() const override; 51 bool WidgetHasHitTestMask() const override;
66 void GetWidgetHitTestMask(gfx::Path* mask) const override; 52 void GetWidgetHitTestMask(gfx::Path* mask) const override;
67 53
68 // views::View implementation. 54 // views::View implementation.
69 gfx::Size GetPreferredSize() const override; 55 gfx::Size GetPreferredSize() const override;
70 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 56 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
71 57
72 // NativeAppWindow implementation. 58 // NativeAppWindow implementation.
73 void SetFullscreen(int fullscreen_types) override; 59 void SetFullscreen(int fullscreen_types) override;
74 bool IsFullscreenOrPending() const override; 60 bool IsFullscreenOrPending() const override;
75 void UpdateBadgeIcon() override; 61 void UpdateBadgeIcon() override;
76 void UpdateShape(scoped_ptr<SkRegion> region) override; 62 void UpdateShape(scoped_ptr<SkRegion> region) override;
77 bool HasFrameColor() const override; 63 bool HasFrameColor() const override;
78 SkColor ActiveFrameColor() const override; 64 SkColor ActiveFrameColor() const override;
79 SkColor InactiveFrameColor() const override; 65 SkColor InactiveFrameColor() const override;
80 void SetInterceptAllKeys(bool want_all_keys) override; 66 void SetInterceptAllKeys(bool want_all_keys) override;
81 67
82 // NativeAppWindowViews implementation. 68 // NativeAppWindowViews implementation.
83 void InitializeWindow( 69 void InitializeWindow(
84 extensions::AppWindow* app_window, 70 extensions::AppWindow* app_window,
85 const extensions::AppWindow::CreateParams& create_params) override; 71 const extensions::AppWindow::CreateParams& create_params) override;
86 72
87 private: 73 private:
88 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest,
89 ResizeInsetsWithinBounds);
90
91 apps::AppWindowFrameView* CreateNonStandardAppFrame();
92
93 // True if the window is fullscreen or fullscreen is pending. 74 // True if the window is fullscreen or fullscreen is pending.
94 bool is_fullscreen_; 75 bool is_fullscreen_;
95 76
96 // Custom shape of the window. If this is not set then the window has a 77 // Custom shape of the window. If this is not set then the window has a
97 // default shape, usually rectangular. 78 // default shape, usually rectangular.
98 scoped_ptr<SkRegion> shape_; 79 scoped_ptr<SkRegion> shape_;
99 80
100 bool has_frame_color_; 81 bool has_frame_color_;
101 SkColor active_frame_color_; 82 SkColor active_frame_color_;
102 SkColor inactive_frame_color_; 83 SkColor inactive_frame_color_;
103 gfx::Size preferred_size_; 84 gfx::Size preferred_size_;
104 85
105 // The class that registers for keyboard shortcuts for extension commands. 86 // The class that registers for keyboard shortcuts for extension commands.
106 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; 87 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_;
107 88
108 #if defined(USE_ASH)
109 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In
110 // immersive fullscreen, the window header (title bar and window controls)
111 // slides onscreen as an overlay when the mouse is hovered at the top of the
112 // screen.
113 scoped_ptr<ash::ImmersiveFullscreenController>
114 immersive_fullscreen_controller_;
115 #endif // defined(USE_ASH)
116
117 // Used to show the system menu.
118 scoped_ptr<views::MenuRunner> menu_runner_;
119
120 // Used to capture all keyboard events including task switching sequence. 89 // Used to capture all keyboard events including task switching sequence.
121 scoped_ptr<DesktopKeyboardCapture> desktop_keyboard_capture_; 90 scoped_ptr<DesktopKeyboardCapture> desktop_keyboard_capture_;
122 91
123 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); 92 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews);
124 }; 93 };
125 94
126 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ 95 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698