OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_STACK_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ | 6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 | 9 |
10 class Panel; | 10 class Panel; |
11 class StackedPanelCollection; | 11 class StackedPanelCollection; |
12 namespace gfx { | 12 namespace gfx { |
13 class Rect; | 13 class Rect; |
14 } | 14 } |
15 | 15 |
16 // An interface that encapsulates the platform-specific behaviors that are | 16 // An interface that encapsulates the platform-specific behaviors that are |
17 // needed to support multiple panels that are stacked together. A native | 17 // needed to support multiple panels that are stacked together. A native |
18 // window might be created to enclose all the panels in the stack. The lifetime | 18 // window might be created to enclose all the panels in the stack. The lifetime |
19 // of the class that implements this interface is managed by itself. | 19 // of the class that implements this interface is managed by itself. |
20 class NativePanelStack { | 20 class NativePanelStackWindow { |
21 public: | 21 public: |
22 // Creates and returns a NativePanelStack instance whose lifetime is managed | 22 // Creates and returns a NativePanelStackWindow instance whose lifetime is |
23 // by itself and it will be valid until Close is called. NativePanelStack | 23 // managed by itself and it will be valid until Close is called. |
24 // also owns the StackedPanelCollection instance being passed here. | 24 // NativePanelStackWindow also owns the StackedPanelCollection instance being |
25 static NativePanelStack* Create(scoped_ptr<StackedPanelCollection> stack); | 25 // passed here. |
| 26 static NativePanelStackWindow* Create( |
| 27 scoped_ptr<StackedPanelCollection> stack); |
26 | 28 |
27 virtual ~NativePanelStack() {} | 29 virtual ~NativePanelStackWindow() {} |
28 | 30 |
29 virtual bool IsMinimized() const = 0; | 31 virtual bool IsMinimized() const = 0; |
30 | 32 |
31 protected: | 33 protected: |
32 friend class StackedPanelCollection; | 34 friend class StackedPanelCollection; |
33 | 35 |
34 // Called when the stack is to be closed. This will destruct the | 36 // Called when the stack is to be closed. This will destruct the |
35 // NativePanelStack instance which causes the StackedPanelCollection | 37 // NativePanelStackWindow instance which causes the StackedPanelCollection |
36 // instance to be also destructed since the former owns the later. | 38 // instance to be also destructed since the former owns the later. |
37 virtual void Close() = 0; | 39 virtual void Close() = 0; |
38 | 40 |
39 // Called when |panel| is being added to or removed from the stack. | 41 // Called when |panel| is being added to or removed from the stack. |
40 virtual void OnPanelAddedOrRemoved(Panel* panel) = 0; | 42 virtual void OnPanelAddedOrRemoved(Panel* panel) = 0; |
41 | 43 |
42 // Sets the bounds that is big enough to enclose all panels in the stack. | 44 // Sets the bounds that is big enough to enclose all panels in the stack. |
43 virtual void SetBounds(const gfx::Rect& bounds) = 0; | 45 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
44 | 46 |
45 // Minimizes all the panels in the stack as a whole via system. | 47 // Minimizes all the panels in the stack as a whole via system. |
46 virtual void Minimize() = 0; | 48 virtual void Minimize() = 0; |
47 | 49 |
48 // Draws or clears the attention via system. The system might choose to | 50 // Draws or clears the attention via system. The system might choose to |
49 // flash the taskbar icon for attention. | 51 // flash the taskbar icon for attention. |
50 virtual void DrawSystemAttention(bool draw_attention) = 0; | 52 virtual void DrawSystemAttention(bool draw_attention) = 0; |
51 }; | 53 }; |
52 | 54 |
53 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ | 55 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_ |
OLD | NEW |