Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: chrome/browser/ui/panels/native_panel.h

Issue 7537030: Make panel adjust bounds per preferred size change notification on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 16 matching lines...) Expand all
27 // still use the BrowserWindow interface as part of their implementation so we 27 // still use the BrowserWindow interface as part of their implementation so we
28 // use Panel in all the method names to avoid collisions. 28 // use Panel in all the method names to avoid collisions.
29 class NativePanel { 29 class NativePanel {
30 friend class Panel; 30 friend class Panel;
31 31
32 protected: 32 protected:
33 virtual ~NativePanel() {} 33 virtual ~NativePanel() {}
34 34
35 virtual void ShowPanel() = 0; 35 virtual void ShowPanel() = 0;
36 virtual void ShowPanelInactive() = 0; 36 virtual void ShowPanelInactive() = 0;
37
38 // The restored bounds are the original bounds when the panel is in expanded
39 // state.
40 virtual gfx::Rect GetPanelRestoredBounds() const = 0;
Dmitry Titov 2011/08/05 19:02:20 As discussed, lets replace RestoredBounds with Res
jianli 2011/08/09 19:56:16 Done.
37 virtual gfx::Rect GetPanelBounds() const = 0; 41 virtual gfx::Rect GetPanelBounds() const = 0;
42 virtual void SetPanelRestoredBounds(const gfx::Rect& bounds) = 0;
38 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; 43 virtual void SetPanelBounds(const gfx::Rect& bounds) = 0;
39 44
40 // The native panel needs to update the bounds. In addition, it needs to watch 45 // The native panel needs to update the bounds. In addition, it needs to watch
41 // for the mouse movement so that it knows when to bring up or down all the 46 // for the mouse movement so that it knows when to bring up or down all the
42 // minimized panels. To do this, when the mouse moves, the native panel needs 47 // minimized panels. To do this, when the mouse moves, the native panel needs
43 // to call PanelManager::ShouldBringUpTitleBarForAllMinimizedPanels to check. 48 // to call PanelManager::ShouldBringUpTitleBarForAllMinimizedPanels to check.
44 virtual void OnPanelExpansionStateChanged( 49 virtual void OnPanelExpansionStateChanged(
45 Panel::ExpansionState expansion_state) = 0; 50 Panel::ExpansionState expansion_state) = 0;
46 51
47 // When the mouse is at (mouse_x, mouse_y) in screen coordinate system, finds 52 // When the mouse is at (mouse_x, mouse_y) in screen coordinate system, finds
48 // out if the title-bar needs to pop up for the minimized panel that is only 53 // out if the title-bar needs to pop up for the minimized panel that is only
49 // shown as 3-pixel lines. 54 // shown as 3-pixel lines.
50 virtual bool ShouldBringUpPanelTitleBar(int mouse_x, int mouse_y) const = 0; 55 virtual bool ShouldBringUpPanelTitleBar(int mouse_x, int mouse_y) const = 0;
51 56
52 virtual void ClosePanel() = 0; 57 virtual void ClosePanel() = 0;
53 virtual void ActivatePanel() = 0; 58 virtual void ActivatePanel() = 0;
54 virtual void DeactivatePanel() = 0; 59 virtual void DeactivatePanel() = 0;
55 virtual bool IsPanelActive() const = 0; 60 virtual bool IsPanelActive() const = 0;
56 virtual gfx::NativeWindow GetNativePanelHandle() = 0; 61 virtual gfx::NativeWindow GetNativePanelHandle() = 0;
57 virtual void UpdatePanelTitleBar() = 0; 62 virtual void UpdatePanelTitleBar() = 0;
58 virtual void ShowTaskManagerForPanel() = 0; 63 virtual void ShowTaskManagerForPanel() = 0;
59 virtual void NotifyPanelOnUserChangedTheme() = 0; 64 virtual void NotifyPanelOnUserChangedTheme() = 0;
60 virtual void DrawAttention() = 0; 65 virtual void DrawAttention() = 0;
61 virtual bool IsDrawingAttention() const = 0; 66 virtual bool IsDrawingAttention() const = 0;
62 virtual Browser* GetPanelBrowser() const = 0; 67 virtual Browser* GetPanelBrowser() const = 0;
63 virtual void DestroyPanelBrowser() = 0; 68 virtual void DestroyPanelBrowser() = 0;
64 69
70 // Returns the size of the non-client area, that is, the window size minus
71 // the size of the client area.
72 virtual gfx::Size GetNonClientAreaSize() const = 0;
73
65 // Returns a pointer to the testing interface to the native panel. 74 // Returns a pointer to the testing interface to the native panel.
66 virtual NativePanelTesting* GetNativePanelTesting() = 0; 75 virtual NativePanelTesting* GetNativePanelTesting() = 0;
67 }; 76 };
68 77
69 // A NativePanel utility interface used for accessing elements of the 78 // A NativePanel utility interface used for accessing elements of the
70 // native panel used only by test automation. 79 // native panel used only by test automation.
71 class NativePanelTesting { 80 class NativePanelTesting {
72 public: 81 public:
73 82
74 protected: 83 protected:
75 virtual ~NativePanelTesting() {} 84 virtual ~NativePanelTesting() {}
76 }; 85 };
77 86
78 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ 87 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698