| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/extensions/chrome_app_icon_delegate.h" |
| 11 #include "extensions/components/native_app_window/native_app_window_views.h" | 12 #include "extensions/components/native_app_window/native_app_window_views.h" |
| 12 | 13 |
| 13 class ExtensionKeybindingRegistryViews; | 14 class ExtensionKeybindingRegistryViews; |
| 14 | 15 |
| 15 class ChromeNativeAppWindowViews | 16 class ChromeNativeAppWindowViews |
| 16 : public native_app_window::NativeAppWindowViews { | 17 : public native_app_window::NativeAppWindowViews, |
| 18 public extensions::ChromeAppIconDelegate { |
| 17 public: | 19 public: |
| 18 ChromeNativeAppWindowViews(); | 20 ChromeNativeAppWindowViews(); |
| 19 ~ChromeNativeAppWindowViews() override; | 21 ~ChromeNativeAppWindowViews() override; |
| 20 | 22 |
| 21 SkRegion* shape() { return shape_.get(); } | 23 SkRegion* shape() { return shape_.get(); } |
| 22 | 24 |
| 23 protected: | 25 protected: |
| 24 // Called before views::Widget::Init() in InitializeDefaultWindow() to allow | 26 // Called before views::Widget::Init() in InitializeDefaultWindow() to allow |
| 25 // subclasses to customize the InitParams that would be passed. | 27 // subclasses to customize the InitParams that would be passed. |
| 26 virtual void OnBeforeWidgetInit( | 28 virtual void OnBeforeWidgetInit( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 bool HasFrameColor() const override; | 65 bool HasFrameColor() const override; |
| 64 SkColor ActiveFrameColor() const override; | 66 SkColor ActiveFrameColor() const override; |
| 65 SkColor InactiveFrameColor() const override; | 67 SkColor InactiveFrameColor() const override; |
| 66 | 68 |
| 67 // NativeAppWindowViews implementation. | 69 // NativeAppWindowViews implementation. |
| 68 void InitializeWindow( | 70 void InitializeWindow( |
| 69 extensions::AppWindow* app_window, | 71 extensions::AppWindow* app_window, |
| 70 const extensions::AppWindow::CreateParams& create_params) override; | 72 const extensions::AppWindow::CreateParams& create_params) override; |
| 71 | 73 |
| 72 private: | 74 private: |
| 75 // Ensures that Chrome app icon is created. |
| 76 void EnsureAppIconCreated(); |
| 77 |
| 78 // extensions::ChromeAppIconDelegate: |
| 79 void OnIconUpdated(extensions::ChromeAppIcon* icon) override; |
| 80 |
| 73 // Custom shape of the window. If this is not set then the window has a | 81 // Custom shape of the window. If this is not set then the window has a |
| 74 // default shape, usually rectangular. | 82 // default shape, usually rectangular. |
| 75 std::unique_ptr<SkRegion> shape_; | 83 std::unique_ptr<SkRegion> shape_; |
| 76 | 84 |
| 77 bool has_frame_color_; | 85 bool has_frame_color_; |
| 78 SkColor active_frame_color_; | 86 SkColor active_frame_color_; |
| 79 SkColor inactive_frame_color_; | 87 SkColor inactive_frame_color_; |
| 80 gfx::Size preferred_size_; | 88 gfx::Size preferred_size_; |
| 81 | 89 |
| 82 // The class that registers for keyboard shortcuts for extension commands. | 90 // The class that registers for keyboard shortcuts for extension commands. |
| 83 std::unique_ptr<ExtensionKeybindingRegistryViews> | 91 std::unique_ptr<ExtensionKeybindingRegistryViews> |
| 84 extension_keybinding_registry_; | 92 extension_keybinding_registry_; |
| 85 | 93 |
| 94 // Contains the default Chrome app icon. It is used in case custom icon for |
| 95 // extension app window is not set or as a part of composite image. |
| 96 std::unique_ptr<extensions::ChromeAppIcon> app_icon_; |
| 97 |
| 86 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); | 98 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); |
| 87 }; | 99 }; |
| 88 | 100 |
| 89 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ | 101 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |