| OLD | NEW |
| 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" | 10 #include "ui/views/context_menu_controller.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace views { | 24 namespace views { |
| 25 class MenuRunner; | 25 class MenuRunner; |
| 26 } | 26 } |
| 27 | 27 |
| 28 class ChromeNativeAppWindowViews | 28 class ChromeNativeAppWindowViews |
| 29 : public native_app_window::NativeAppWindowViews, | 29 : public native_app_window::NativeAppWindowViews, |
| 30 public views::ContextMenuController { | 30 public views::ContextMenuController { |
| 31 public: | 31 public: |
| 32 ChromeNativeAppWindowViews(); | 32 ChromeNativeAppWindowViews(); |
| 33 virtual ~ChromeNativeAppWindowViews(); | 33 ~ChromeNativeAppWindowViews() override; |
| 34 | 34 |
| 35 SkRegion* shape() { return shape_.get(); } | 35 SkRegion* shape() { return shape_.get(); } |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 // Called before views::Widget::Init() to allow subclasses to customize | 38 // Called before views::Widget::Init() to allow subclasses to customize |
| 39 // the InitParams that would be passed. | 39 // the InitParams that would be passed. |
| 40 virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params, | 40 virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params, |
| 41 views::Widget* widget); | 41 views::Widget* widget); |
| 42 | 42 |
| 43 virtual void InitializeDefaultWindow( | 43 virtual void InitializeDefaultWindow( |
| 44 const extensions::AppWindow::CreateParams& create_params); | 44 const extensions::AppWindow::CreateParams& create_params); |
| 45 virtual void InitializePanelWindow( | 45 virtual void InitializePanelWindow( |
| 46 const extensions::AppWindow::CreateParams& create_params); | 46 const extensions::AppWindow::CreateParams& create_params); |
| 47 virtual views::NonClientFrameView* CreateStandardDesktopAppFrame(); | 47 virtual views::NonClientFrameView* CreateStandardDesktopAppFrame(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest, | 50 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest, |
| 51 ResizeInsetsWithinBounds); | 51 ResizeInsetsWithinBounds); |
| 52 | 52 |
| 53 apps::AppWindowFrameView* CreateNonStandardAppFrame(); | 53 apps::AppWindowFrameView* CreateNonStandardAppFrame(); |
| 54 | 54 |
| 55 // ui::BaseWindow implementation. | 55 // ui::BaseWindow implementation. |
| 56 virtual gfx::Rect GetRestoredBounds() const override; | 56 gfx::Rect GetRestoredBounds() const override; |
| 57 virtual ui::WindowShowState GetRestoredState() const override; | 57 ui::WindowShowState GetRestoredState() const override; |
| 58 virtual bool IsAlwaysOnTop() const override; | 58 bool IsAlwaysOnTop() const override; |
| 59 | 59 |
| 60 // Overridden from views::ContextMenuController: | 60 // Overridden from views::ContextMenuController: |
| 61 virtual void ShowContextMenuForView(views::View* source, | 61 void ShowContextMenuForView(views::View* source, |
| 62 const gfx::Point& p, | 62 const gfx::Point& p, |
| 63 ui::MenuSourceType source_type) override; | 63 ui::MenuSourceType source_type) override; |
| 64 | 64 |
| 65 // WidgetDelegate implementation. | 65 // WidgetDelegate implementation. |
| 66 virtual gfx::ImageSkia GetWindowAppIcon() override; | 66 gfx::ImageSkia GetWindowAppIcon() override; |
| 67 virtual gfx::ImageSkia GetWindowIcon() override; | 67 gfx::ImageSkia GetWindowIcon() override; |
| 68 virtual views::NonClientFrameView* CreateNonClientFrameView( | 68 views::NonClientFrameView* CreateNonClientFrameView( |
| 69 views::Widget* widget) override; | 69 views::Widget* widget) override; |
| 70 virtual bool WidgetHasHitTestMask() const override; | 70 bool WidgetHasHitTestMask() const override; |
| 71 virtual void GetWidgetHitTestMask(gfx::Path* mask) const override; | 71 void GetWidgetHitTestMask(gfx::Path* mask) const override; |
| 72 | 72 |
| 73 // views::View implementation. | 73 // views::View implementation. |
| 74 virtual gfx::Size GetPreferredSize() const override; | 74 gfx::Size GetPreferredSize() const override; |
| 75 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 75 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 76 | 76 |
| 77 // NativeAppWindow implementation. | 77 // NativeAppWindow implementation. |
| 78 virtual void SetFullscreen(int fullscreen_types) override; | 78 void SetFullscreen(int fullscreen_types) override; |
| 79 virtual bool IsFullscreenOrPending() const override; | 79 bool IsFullscreenOrPending() const override; |
| 80 virtual void UpdateBadgeIcon() override; | 80 void UpdateBadgeIcon() override; |
| 81 virtual void UpdateShape(scoped_ptr<SkRegion> region) override; | 81 void UpdateShape(scoped_ptr<SkRegion> region) override; |
| 82 virtual bool HasFrameColor() const override; | 82 bool HasFrameColor() const override; |
| 83 virtual SkColor ActiveFrameColor() const override; | 83 SkColor ActiveFrameColor() const override; |
| 84 virtual SkColor InactiveFrameColor() const override; | 84 SkColor InactiveFrameColor() const override; |
| 85 | 85 |
| 86 // NativeAppWindowViews implementation. | 86 // NativeAppWindowViews implementation. |
| 87 virtual void InitializeWindow( | 87 void InitializeWindow( |
| 88 extensions::AppWindow* app_window, | 88 extensions::AppWindow* app_window, |
| 89 const extensions::AppWindow::CreateParams& create_params) override; | 89 const extensions::AppWindow::CreateParams& create_params) override; |
| 90 | 90 |
| 91 // True if the window is fullscreen or fullscreen is pending. | 91 // True if the window is fullscreen or fullscreen is pending. |
| 92 bool is_fullscreen_; | 92 bool is_fullscreen_; |
| 93 | 93 |
| 94 // Custom shape of the window. If this is not set then the window has a | 94 // Custom shape of the window. If this is not set then the window has a |
| 95 // default shape, usually rectangular. | 95 // default shape, usually rectangular. |
| 96 scoped_ptr<SkRegion> shape_; | 96 scoped_ptr<SkRegion> shape_; |
| 97 | 97 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 112 immersive_fullscreen_controller_; | 112 immersive_fullscreen_controller_; |
| 113 #endif // defined(USE_ASH) | 113 #endif // defined(USE_ASH) |
| 114 | 114 |
| 115 // Used to show the system menu. | 115 // Used to show the system menu. |
| 116 scoped_ptr<views::MenuRunner> menu_runner_; | 116 scoped_ptr<views::MenuRunner> menu_runner_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); | 118 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ | 121 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |