Chromium Code Reviews| 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" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 // windows. We use this interface for two reasons: | 21 // windows. We use this interface for two reasons: |
| 22 // 1. We don't want to use BrowserWindow as the interface between shared panel | 22 // 1. We don't want to use BrowserWindow as the interface between shared panel |
| 23 // code and platform-specific code. BrowserWindow has a lot of methods, most | 23 // code and platform-specific code. BrowserWindow has a lot of methods, most |
| 24 // of which we don't use and simply stub out with NOTIMPLEMENTED(). | 24 // of which we don't use and simply stub out with NOTIMPLEMENTED(). |
| 25 // 2. We need some additional methods that BrowserWindow doesn't provide, such | 25 // 2. We need some additional methods that BrowserWindow doesn't provide, such |
| 26 // as MinimizePanel() and RestorePanel(). | 26 // as MinimizePanel() and RestorePanel(). |
| 27 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ | 27 // Note that even though we don't use BrowserWindow directly, Windows and GTK+ |
| 28 // still use the BrowserWindow interface as part of their implementation so we | 28 // still use the BrowserWindow interface as part of their implementation so we |
| 29 // use Panel in all the method names to avoid collisions. | 29 // use Panel in all the method names to avoid collisions. |
| 30 class NativePanel { | 30 class NativePanel { |
| 31 friend class Panel; | 31 public: |
|
jennb
2011/12/01 20:10:33
Why not keep protected and have all panel strips g
Dmitry Titov
2011/12/01 20:14:45
I answered this above. It creates a lot of 'retran
| |
| 32 friend class PanelBrowserTest; | |
| 33 | |
| 34 protected: | |
| 35 virtual ~NativePanel() {} | 32 virtual ~NativePanel() {} |
| 36 | 33 |
| 37 virtual void ShowPanel() = 0; | 34 virtual void ShowPanel() = 0; |
| 38 virtual void ShowPanelInactive() = 0; | 35 virtual void ShowPanelInactive() = 0; |
| 39 virtual gfx::Rect GetPanelBounds() const = 0; | 36 virtual gfx::Rect GetPanelBounds() const = 0; |
| 40 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; | 37 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; |
| 41 virtual void ClosePanel() = 0; | 38 virtual void ClosePanel() = 0; |
| 42 virtual void ActivatePanel() = 0; | 39 virtual void ActivatePanel() = 0; |
| 43 virtual void DeactivatePanel() = 0; | 40 virtual void DeactivatePanel() = 0; |
| 44 virtual bool IsPanelActive() const = 0; | 41 virtual bool IsPanelActive() const = 0; |
| 45 virtual gfx::NativeWindow GetNativePanelHandle() = 0; | 42 virtual gfx::NativeWindow GetNativePanelHandle() = 0; |
| 46 virtual void UpdatePanelTitleBar() = 0; | 43 virtual void UpdatePanelTitleBar() = 0; |
| 47 virtual void UpdatePanelLoadingAnimations(bool should_animate) = 0; | 44 virtual void UpdatePanelLoadingAnimations(bool should_animate) = 0; |
| 48 virtual void ShowTaskManagerForPanel() = 0; | 45 virtual void ShowTaskManagerForPanel() = 0; |
| 49 virtual FindBar* CreatePanelFindBar() = 0; | 46 virtual FindBar* CreatePanelFindBar() = 0; |
| 50 virtual void NotifyPanelOnUserChangedTheme() = 0; | 47 virtual void NotifyPanelOnUserChangedTheme() = 0; |
| 51 virtual void PanelTabContentsFocused(TabContents* tab_contents) = 0; | 48 virtual void PanelTabContentsFocused(TabContents* tab_contents) = 0; |
| 52 virtual void PanelCut() = 0; | 49 virtual void PanelCut() = 0; |
| 53 virtual void PanelCopy() = 0; | 50 virtual void PanelCopy() = 0; |
| 54 virtual void PanelPaste() = 0; | 51 virtual void PanelPaste() = 0; |
| 55 virtual void DrawAttention() = 0; | 52 virtual void DrawAttention() = 0; |
| 56 virtual bool IsDrawingAttention() const = 0; | 53 virtual bool IsDrawingAttention() const = 0; |
| 57 virtual bool PreHandlePanelKeyboardEvent( | 54 virtual bool PreHandlePanelKeyboardEvent( |
| 58 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) = 0; | 55 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) = 0; |
| 59 virtual void HandlePanelKeyboardEvent( | 56 virtual void HandlePanelKeyboardEvent( |
| 60 const NativeWebKeyboardEvent& event) = 0; | 57 const NativeWebKeyboardEvent& event) = 0; |
| 61 | 58 |
| 59 // This function will only get called by one of the panel strips when full | |
| 60 // screen mode changes i.e it gets called when an app goes into full screen | |
| 61 // mode or when an app exits full screen mode. Panel should respond by making | |
| 62 // sure: | |
| 63 // a) it does not go on top when some app enters full screen mode. | |
| 64 // b) it remains on top when an app exits full screen mode. | |
| 65 virtual void FullScreenModeChanged(bool is_full_screen_mode_on) = 0; | |
| 66 | |
| 62 virtual Browser* GetPanelBrowser() const = 0; | 67 virtual Browser* GetPanelBrowser() const = 0; |
| 63 virtual void DestroyPanelBrowser() = 0; | 68 virtual void DestroyPanelBrowser() = 0; |
| 64 | 69 |
| 65 // Returns the exterior size of the panel window given the client content | 70 // Returns the exterior size of the panel window given the client content |
| 66 // size and vice versa. | 71 // size and vice versa. |
| 67 virtual gfx::Size WindowSizeFromContentSize( | 72 virtual gfx::Size WindowSizeFromContentSize( |
| 68 const gfx::Size& content_size) const = 0; | 73 const gfx::Size& content_size) const = 0; |
| 69 virtual gfx::Size ContentSizeFromWindowSize( | 74 virtual gfx::Size ContentSizeFromWindowSize( |
| 70 const gfx::Size& window_size) const = 0; | 75 const gfx::Size& window_size) const = 0; |
| 71 | 76 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 91 // Verifies, on a deepest possible level, if the native panel is really | 96 // Verifies, on a deepest possible level, if the native panel is really |
| 92 // active, i.e. the titlebar is painted per its active state. | 97 // active, i.e. the titlebar is painted per its active state. |
| 93 virtual bool VerifyActiveState(bool is_active) = 0; | 98 virtual bool VerifyActiveState(bool is_active) = 0; |
| 94 virtual void WaitForWindowCreationToComplete() const { } | 99 virtual void WaitForWindowCreationToComplete() const { } |
| 95 | 100 |
| 96 virtual bool IsWindowSizeKnown() const = 0; | 101 virtual bool IsWindowSizeKnown() const = 0; |
| 97 virtual bool IsAnimatingBounds() const = 0; | 102 virtual bool IsAnimatingBounds() const = 0; |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ | 105 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ |
| OLD | NEW |