Chromium Code Reviews| 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 |
| 16 namespace extensions { | |
| 17 class ChromeAppIcon; | |
|
msw
2017/05/23 00:02:29
nit: not needed (fwd decl in chrome_app_icon_deleg
khmel
2017/05/23 16:11:44
Done.
| |
| 18 } | |
| 19 | |
| 15 class ChromeNativeAppWindowViews | 20 class ChromeNativeAppWindowViews |
| 16 : public native_app_window::NativeAppWindowViews { | 21 : public native_app_window::NativeAppWindowViews, |
| 22 public extensions::ChromeAppIconDelegate { | |
| 17 public: | 23 public: |
| 18 ChromeNativeAppWindowViews(); | 24 ChromeNativeAppWindowViews(); |
| 19 ~ChromeNativeAppWindowViews() override; | 25 ~ChromeNativeAppWindowViews() override; |
| 20 | 26 |
| 21 SkRegion* shape() { return shape_.get(); } | 27 SkRegion* shape() { return shape_.get(); } |
| 22 | 28 |
| 23 protected: | 29 protected: |
| 24 // Called before views::Widget::Init() in InitializeDefaultWindow() to allow | 30 // Called before views::Widget::Init() in InitializeDefaultWindow() to allow |
| 25 // subclasses to customize the InitParams that would be passed. | 31 // subclasses to customize the InitParams that would be passed. |
| 26 virtual void OnBeforeWidgetInit( | 32 virtual void OnBeforeWidgetInit( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 bool HasFrameColor() const override; | 69 bool HasFrameColor() const override; |
| 64 SkColor ActiveFrameColor() const override; | 70 SkColor ActiveFrameColor() const override; |
| 65 SkColor InactiveFrameColor() const override; | 71 SkColor InactiveFrameColor() const override; |
| 66 | 72 |
| 67 // NativeAppWindowViews implementation. | 73 // NativeAppWindowViews implementation. |
| 68 void InitializeWindow( | 74 void InitializeWindow( |
| 69 extensions::AppWindow* app_window, | 75 extensions::AppWindow* app_window, |
| 70 const extensions::AppWindow::CreateParams& create_params) override; | 76 const extensions::AppWindow::CreateParams& create_params) override; |
| 71 | 77 |
| 72 private: | 78 private: |
| 79 void EnsureAppIconCreated(); | |
|
msw
2017/05/23 00:02:30
nit: comment.
khmel
2017/05/23 16:11:44
Done.
| |
| 80 | |
| 81 // extensions::ChromeAppIconDelegate: | |
| 82 void OnIconUpdated(extensions::ChromeAppIcon* icon) override; | |
| 83 | |
| 73 // Custom shape of the window. If this is not set then the window has a | 84 // Custom shape of the window. If this is not set then the window has a |
| 74 // default shape, usually rectangular. | 85 // default shape, usually rectangular. |
| 75 std::unique_ptr<SkRegion> shape_; | 86 std::unique_ptr<SkRegion> shape_; |
| 76 | 87 |
| 77 bool has_frame_color_; | 88 bool has_frame_color_; |
| 78 SkColor active_frame_color_; | 89 SkColor active_frame_color_; |
| 79 SkColor inactive_frame_color_; | 90 SkColor inactive_frame_color_; |
| 80 gfx::Size preferred_size_; | 91 gfx::Size preferred_size_; |
| 81 | 92 |
| 82 // The class that registers for keyboard shortcuts for extension commands. | 93 // The class that registers for keyboard shortcuts for extension commands. |
| 83 std::unique_ptr<ExtensionKeybindingRegistryViews> | 94 std::unique_ptr<ExtensionKeybindingRegistryViews> |
| 84 extension_keybinding_registry_; | 95 extension_keybinding_registry_; |
| 85 | 96 |
| 97 std::unique_ptr<extensions::ChromeAppIcon> app_icon_; | |
|
msw
2017/05/23 00:02:29
nit: comment
khmel
2017/05/23 16:11:44
Done.
| |
| 98 | |
| 86 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); | 99 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); |
| 87 }; | 100 }; |
| 88 | 101 |
| 89 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ | 102 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |