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_NATIVE_PANEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ |
6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ | 6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 | 11 |
| 12 class Browser; |
12 class FindBar; | 13 class FindBar; |
13 class NativePanelTesting; | 14 class NativePanelTesting; |
14 | 15 |
15 namespace content { | 16 namespace content { |
| 17 struct NativeWebKeyboardEvent; |
16 class WebContents; | 18 class WebContents; |
17 } | 19 } |
18 | 20 |
19 namespace gfx { | 21 namespace gfx { |
20 class Rect; | 22 class Rect; |
21 } // namespace gfx | 23 } // namespace gfx |
22 | 24 |
23 // An interface for a class that implements platform-specific behavior for panel | 25 // An interface for a class that implements platform-specific behavior for panel |
24 // windows. We use this interface for two reasons: | 26 // windows. We use this interface for two reasons: |
25 // 1. We don't want to use BrowserWindow as the interface between shared panel | 27 // 1. We don't want to use BrowserWindow as the interface between shared panel |
26 // code and platform-specific code. BrowserWindow has a lot of methods, most | 28 // code and platform-specific code. BrowserWindow has a lot of methods, most |
27 // of which we don't use and simply stub out with NOTIMPLEMENTED(). | 29 // of which we don't use and simply stub out with NOTIMPLEMENTED(). |
28 // 2. We need some additional methods that BrowserWindow doesn't provide, such | 30 // 2. We need some additional methods that BrowserWindow doesn't provide, such |
29 // as MinimizePanel() and RestorePanel(). | 31 // as MinimizePanel() and RestorePanel(). |
30 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ | 32 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ |
31 // still use the BrowserWindow interface as part of their implementation so we | 33 // still use the BrowserWindow interface as part of their implementation so we |
32 // use Panel in all the method names to avoid collisions. | 34 // use Panel in all the method names to avoid collisions. |
33 class NativePanel { | 35 class NativePanel { |
34 friend class Panel; | 36 friend class Panel; |
| 37 friend class PanelBrowserWindow; |
35 friend class PanelBrowserTest; | 38 friend class PanelBrowserTest; |
36 | 39 |
37 protected: | 40 protected: |
38 virtual ~NativePanel() {} | 41 virtual ~NativePanel() {} |
39 | 42 |
40 virtual void ShowPanel() = 0; | 43 virtual void ShowPanel() = 0; |
41 virtual void ShowPanelInactive() = 0; | 44 virtual void ShowPanelInactive() = 0; |
42 virtual gfx::Rect GetPanelBounds() const = 0; | 45 virtual gfx::Rect GetPanelBounds() const = 0; |
43 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; | 46 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; |
44 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) = 0; | 47 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) = 0; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // active, i.e. the titlebar is painted per its active state. | 131 // active, i.e. the titlebar is painted per its active state. |
129 virtual bool VerifyActiveState(bool is_active) = 0; | 132 virtual bool VerifyActiveState(bool is_active) = 0; |
130 virtual void WaitForWindowCreationToComplete() const { } | 133 virtual void WaitForWindowCreationToComplete() const { } |
131 | 134 |
132 virtual bool IsWindowSizeKnown() const = 0; | 135 virtual bool IsWindowSizeKnown() const = 0; |
133 virtual bool IsAnimatingBounds() const = 0; | 136 virtual bool IsAnimatingBounds() const = 0; |
134 virtual bool IsButtonVisible(TitlebarButtonType button_type) const = 0; | 137 virtual bool IsButtonVisible(TitlebarButtonType button_type) const = 0; |
135 }; | 138 }; |
136 | 139 |
137 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ | 140 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ |
OLD | NEW |