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 |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 bool HasFrameColor() const override; | 64 bool HasFrameColor() const override; |
| 63 SkColor ActiveFrameColor() const override; | 65 SkColor ActiveFrameColor() const override; |
| 64 SkColor InactiveFrameColor() const override; | 66 SkColor InactiveFrameColor() const override; |
| 65 | 67 |
| 66 // NativeAppWindowViews implementation. | 68 // NativeAppWindowViews implementation. |
| 67 void InitializeWindow( | 69 void InitializeWindow( |
| 68 extensions::AppWindow* app_window, | 70 extensions::AppWindow* app_window, |
| 69 const extensions::AppWindow::CreateParams& create_params) override; | 71 const extensions::AppWindow::CreateParams& create_params) override; |
| 70 | 72 |
| 71 private: | 73 private: |
| 74 // Ensures that Chrome app icon is created. | |
|
msw
2017/06/01 19:47:29
nit: "the Chrome"
khmel
2017/06/01 21:55:46
Done.
| |
| 75 void EnsureAppIconCreated(); | |
| 76 | |
| 77 // extensions::ChromeAppIconDelegate: | |
| 78 void OnIconUpdated(extensions::ChromeAppIcon* icon) override; | |
| 79 | |
| 72 // Custom shape of the window. If this is not set then the window has a | 80 // Custom shape of the window. If this is not set then the window has a |
| 73 // default shape, usually rectangular. | 81 // default shape, usually rectangular. |
| 74 std::unique_ptr<SkRegion> shape_; | 82 std::unique_ptr<SkRegion> shape_; |
| 75 | 83 |
| 76 bool has_frame_color_; | 84 bool has_frame_color_; |
| 77 SkColor active_frame_color_; | 85 SkColor active_frame_color_; |
| 78 SkColor inactive_frame_color_; | 86 SkColor inactive_frame_color_; |
| 79 | 87 |
| 80 // The class that registers for keyboard shortcuts for extension commands. | 88 // The class that registers for keyboard shortcuts for extension commands. |
| 81 std::unique_ptr<ExtensionKeybindingRegistryViews> | 89 std::unique_ptr<ExtensionKeybindingRegistryViews> |
| 82 extension_keybinding_registry_; | 90 extension_keybinding_registry_; |
| 83 | 91 |
| 92 // Contains the default Chrome app icon. It is used in case custom icon for | |
|
msw
2017/06/01 19:47:28
nit: "the custom"
khmel
2017/06/01 21:55:46
Done.
| |
| 93 // extension app window is not set or as a part of composite image. | |
|
msw
2017/06/01 19:47:29
"the extension", "set, or"
khmel
2017/06/01 21:55:46
Done.
| |
| 94 std::unique_ptr<extensions::ChromeAppIcon> app_icon_; | |
| 95 | |
| 84 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); | 96 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews); |
| 85 }; | 97 }; |
| 86 | 98 |
| 87 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ | 99 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |