| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PANELS_PANEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 enum AttentionMode { | 68 enum AttentionMode { |
| 69 // Uses the panel attention. The panel's titlebar would be painted | 69 // Uses the panel attention. The panel's titlebar would be painted |
| 70 // differently to attract the user's attention. This is the default mode. | 70 // differently to attract the user's attention. This is the default mode. |
| 71 USE_PANEL_ATTENTION = 0x01, | 71 USE_PANEL_ATTENTION = 0x01, |
| 72 // Uses the system attention. On Windows or Linux (depending on Window | 72 // Uses the system attention. On Windows or Linux (depending on Window |
| 73 // Manager), the app icon on taskbar will be flashed. On MacOS, the dock | 73 // Manager), the app icon on taskbar will be flashed. On MacOS, the dock |
| 74 // icon will jump once. | 74 // icon will jump once. |
| 75 USE_SYSTEM_ATTENTION = 0x02 | 75 USE_SYSTEM_ATTENTION = 0x02 |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 virtual ~Panel(); | 78 ~Panel() override; |
| 79 | 79 |
| 80 // Returns the PanelManager associated with this panel. | 80 // Returns the PanelManager associated with this panel. |
| 81 PanelManager* manager() const; | 81 PanelManager* manager() const; |
| 82 | 82 |
| 83 const std::string& app_name() const { return app_name_; } | 83 const std::string& app_name() const { return app_name_; } |
| 84 const gfx::Image& app_icon() const { return app_icon_; } | 84 const gfx::Image& app_icon() const { return app_icon_; } |
| 85 const SessionID& session_id() const { return session_id_; } | 85 const SessionID& session_id() const { return session_id_; } |
| 86 extensions::WindowController* extension_window_controller() const { | 86 extensions::WindowController* extension_window_controller() const { |
| 87 return extension_window_controller_.get(); | 87 return extension_window_controller_.get(); |
| 88 } | 88 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 109 void FullScreenModeChanged(bool is_full_screen); | 109 void FullScreenModeChanged(bool is_full_screen); |
| 110 | 110 |
| 111 int TitleOnlyHeight() const; | 111 int TitleOnlyHeight() const; |
| 112 | 112 |
| 113 // Returns true if the panel can show minimize or restore button in its | 113 // Returns true if the panel can show minimize or restore button in its |
| 114 // titlebar, depending on its state. | 114 // titlebar, depending on its state. |
| 115 bool CanShowMinimizeButton() const; | 115 bool CanShowMinimizeButton() const; |
| 116 bool CanShowRestoreButton() const; | 116 bool CanShowRestoreButton() const; |
| 117 | 117 |
| 118 // ui::BaseWindow overrides. | 118 // ui::BaseWindow overrides. |
| 119 virtual bool IsActive() const override; | 119 bool IsActive() const override; |
| 120 virtual bool IsMaximized() const override; | 120 bool IsMaximized() const override; |
| 121 virtual bool IsMinimized() const override; | 121 bool IsMinimized() const override; |
| 122 virtual bool IsFullscreen() const override; | 122 bool IsFullscreen() const override; |
| 123 virtual gfx::NativeWindow GetNativeWindow() override; | 123 gfx::NativeWindow GetNativeWindow() override; |
| 124 virtual gfx::Rect GetRestoredBounds() const override; | 124 gfx::Rect GetRestoredBounds() const override; |
| 125 virtual ui::WindowShowState GetRestoredState() const override; | 125 ui::WindowShowState GetRestoredState() const override; |
| 126 virtual gfx::Rect GetBounds() const override; | 126 gfx::Rect GetBounds() const override; |
| 127 virtual void Show() override; | 127 void Show() override; |
| 128 virtual void Hide() override; | 128 void Hide() override; |
| 129 virtual void ShowInactive() override; | 129 void ShowInactive() override; |
| 130 virtual void Close() override; | 130 void Close() override; |
| 131 virtual void Activate() override; | 131 void Activate() override; |
| 132 virtual void Deactivate() override; | 132 void Deactivate() override; |
| 133 virtual void Maximize() override; | 133 void Maximize() override; |
| 134 virtual void Minimize() override; | 134 void Minimize() override; |
| 135 virtual void Restore() override; | 135 void Restore() override; |
| 136 virtual void SetBounds(const gfx::Rect& bounds) override; | 136 void SetBounds(const gfx::Rect& bounds) override; |
| 137 virtual void FlashFrame(bool flash) override; | 137 void FlashFrame(bool flash) override; |
| 138 virtual bool IsAlwaysOnTop() const override; | 138 bool IsAlwaysOnTop() const override; |
| 139 virtual void SetAlwaysOnTop(bool on_top) override; | 139 void SetAlwaysOnTop(bool on_top) override; |
| 140 | 140 |
| 141 // Overridden from CommandUpdaterDelegate: | 141 // Overridden from CommandUpdaterDelegate: |
| 142 virtual void ExecuteCommandWithDisposition( | 142 void ExecuteCommandWithDisposition(int id, WindowOpenDisposition disposition) |
| 143 int id, | 143 override; |
| 144 WindowOpenDisposition disposition) override; | |
| 145 | 144 |
| 146 // content::NotificationObserver overrides. | 145 // content::NotificationObserver overrides. |
| 147 virtual void Observe(int type, | 146 void Observe(int type, |
| 148 const content::NotificationSource& source, | 147 const content::NotificationSource& source, |
| 149 const content::NotificationDetails& details) override; | 148 const content::NotificationDetails& details) override; |
| 150 | 149 |
| 151 // extensions::ExtensionRegistryObserver. | 150 // extensions::ExtensionRegistryObserver. |
| 152 virtual void OnExtensionUnloaded( | 151 void OnExtensionUnloaded( |
| 153 content::BrowserContext* browser_context, | 152 content::BrowserContext* browser_context, |
| 154 const extensions::Extension* extension, | 153 const extensions::Extension* extension, |
| 155 extensions::UnloadedExtensionInfo::Reason reason) override; | 154 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 156 | 155 |
| 157 // Construct a native panel implementation. | 156 // Construct a native panel implementation. |
| 158 static NativePanel* CreateNativePanel(Panel* panel, | 157 static NativePanel* CreateNativePanel(Panel* panel, |
| 159 const gfx::Rect& bounds, | 158 const gfx::Rect& bounds, |
| 160 bool always_on_top); | 159 bool always_on_top); |
| 161 | 160 |
| 162 NativePanel* native_panel() const { return native_panel_; } | 161 NativePanel* native_panel() const { return native_panel_; } |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 403 |
| 405 // Icon showed in the task bar. | 404 // Icon showed in the task bar. |
| 406 gfx::Image app_icon_; | 405 gfx::Image app_icon_; |
| 407 | 406 |
| 408 base::WeakPtrFactory<Panel> image_loader_ptr_factory_; | 407 base::WeakPtrFactory<Panel> image_loader_ptr_factory_; |
| 409 | 408 |
| 410 DISALLOW_COPY_AND_ASSIGN(Panel); | 409 DISALLOW_COPY_AND_ASSIGN(Panel); |
| 411 }; | 410 }; |
| 412 | 411 |
| 413 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 412 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
| OLD | NEW |