OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" | |
jennb
2011/06/29 23:17:54
Gut reaction was this include felt circular. We're
jianli
2011/06/30 01:28:33
It is really not circular. Though it is kind of ug
| |
9 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
10 | 11 |
11 class Panel; | 12 class Panel; |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 class Rect; | 15 class Rect; |
15 } // namespace gfx | 16 } // namespace gfx |
16 | 17 |
17 // An interface for a class that implements platform-specific behavior for panel | 18 // An interface for a class that implements platform-specific behavior for panel |
18 // windows. We use this interface for two reasons: | 19 // windows. We use this interface for two reasons: |
19 // 1. We don't want to use BrowserWindow as the interface between shared panel | 20 // 1. We don't want to use BrowserWindow as the interface between shared panel |
20 // code and platform-specific code. BrowserWindow has a lot of methods, most | 21 // code and platform-specific code. BrowserWindow has a lot of methods, most |
21 // of which we don't use and simply stub out with NOTIMPLEMENTED(). | 22 // of which we don't use and simply stub out with NOTIMPLEMENTED(). |
22 // 2. We need some additional methods that BrowserWindow doesn't provide, such | 23 // 2. We need some additional methods that BrowserWindow doesn't provide, such |
23 // as MinimizePanel() and RestorePanel(). | 24 // as MinimizePanel() and RestorePanel(). |
24 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ | 25 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ |
25 // still use the BrowserWindow interface as part of their implementation so we | 26 // still use the BrowserWindow interface as part of their implementation so we |
26 // use Panel in all the method names to avoid collisions. | 27 // use Panel in all the method names to avoid collisions. |
27 class NativePanel { | 28 class NativePanel { |
28 friend class Panel; | 29 friend class Panel; |
29 | 30 |
30 protected: | 31 protected: |
31 virtual ~NativePanel() {} | 32 virtual ~NativePanel() {} |
32 | 33 |
33 virtual void ShowPanel() = 0; | 34 virtual void ShowPanel() = 0; |
34 virtual void ShowPanelInactive() = 0; | 35 virtual void ShowPanelInactive() = 0; |
35 virtual gfx::Rect GetPanelBounds() const = 0; | 36 virtual gfx::Rect GetPanelBounds() const = 0; |
36 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; | 37 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; |
37 virtual void MinimizePanel() = 0; | 38 virtual void SetPanelExpansionState( |
38 virtual void RestorePanel() = 0; | 39 Panel::ExpansionState expansion_state) = 0; |
40 virtual bool ShouldBringUpPanelTitleBar(int mouse_x, int mouse_y) const = 0; | |
jennb
2011/06/29 23:17:54
Could you add comments explaining what x and y are
jianli
2011/06/30 01:28:33
Done.
| |
39 virtual void ClosePanel() = 0; | 41 virtual void ClosePanel() = 0; |
40 virtual void ActivatePanel() = 0; | 42 virtual void ActivatePanel() = 0; |
41 virtual void DeactivatePanel() = 0; | 43 virtual void DeactivatePanel() = 0; |
42 virtual bool IsPanelActive() const = 0; | 44 virtual bool IsPanelActive() const = 0; |
43 virtual gfx::NativeWindow GetNativePanelHandle() = 0; | 45 virtual gfx::NativeWindow GetNativePanelHandle() = 0; |
44 virtual void UpdatePanelTitleBar() = 0; | 46 virtual void UpdatePanelTitleBar() = 0; |
45 virtual void ShowTaskManagerForPanel() = 0; | 47 virtual void ShowTaskManagerForPanel() = 0; |
46 virtual void NotifyPanelOnUserChangedTheme() = 0; | 48 virtual void NotifyPanelOnUserChangedTheme() = 0; |
47 virtual void FlashPanelFrame() = 0; | 49 virtual void FlashPanelFrame() = 0; |
48 virtual void DestroyPanelBrowser() = 0; | 50 virtual void DestroyPanelBrowser() = 0; |
49 }; | 51 }; |
50 | 52 |
51 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ | 53 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ |
OLD | NEW |