OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 |
| 10 class Panel; |
| 11 class StackedPanelCollection; |
| 12 namespace gfx { |
| 13 class Rect; |
| 14 } |
| 15 |
| 16 // An interface that encapsulates the platform-specific behaviors that are |
| 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 |
| 19 // of the class that implements this interface is managed by itself. |
| 20 class NativePanelStack { |
| 21 public: |
| 22 // Creates and returns a NativePanelStack instance whose lifetime is managed |
| 23 // by itself and it will be valid until Close is called. NativePanelStack |
| 24 // also owns the StackedPanelCollection instance being passed here. |
| 25 static NativePanelStack* Create(scoped_ptr<StackedPanelCollection> stack); |
| 26 |
| 27 virtual ~NativePanelStack() {} |
| 28 |
| 29 protected: |
| 30 friend class StackedPanelCollection; |
| 31 |
| 32 // Called when the stack is to be closed. This will destruct the |
| 33 // NativePanelStack instance which causes the StackedPanelCollection |
| 34 // instance to be also destructed since the former owns the later. |
| 35 virtual void Close() = 0; |
| 36 |
| 37 // Called when |panel| is being added to or removed from the stack. |
| 38 virtual void OnPanelAddedOrRemoved(Panel* panel) = 0; |
| 39 |
| 40 // Sets the bounds that is big enough to enclose all panels in the stack. |
| 41 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |
OLD | NEW |