Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 class Panel; | |
| 9 class StackedPanelCollection; | |
| 10 namespace gfx { | |
| 11 class Rect; | |
| 12 } | |
| 13 | |
| 14 // An interface that encapsulates the platform-specific behaviors that are | |
| 15 // needed to support multiple panels that are stacked together. A native | |
| 16 // window might be created to enclose all the panels in the stack. The lifetime | |
| 17 // of the class that implements this interface is managed by itself. | |
| 18 class NativePanelStack { | |
| 19 friend class StackedPanelCollection; | |
|
dcheng
2013/01/10 22:39:03
Isn't typical convention to put these in an explic
jianli
2013/01/10 23:23:23
Done.
| |
| 20 | |
| 21 public: | |
| 22 // The StackedPanelCollection instance is passed and owned by the | |
| 23 // NativePanelStack instance that is being created. | |
| 24 static NativePanelStack* Create(StackedPanelCollection* stack); | |
|
dcheng
2013/01/10 22:39:03
I know we don't do it elsewhere at the moment, but
jianli
2013/01/10 23:23:23
No, we can't do that since the lifetime of NativeP
dcheng
2013/01/10 23:43:01
At the very least, StackedPanelCollection should s
| |
| 25 virtual ~NativePanelStack() {} | |
| 26 | |
| 27 protected: | |
| 28 // Called when the stack is to be closed. This will destruct the | |
| 29 // NativePanelStack instance which causes the StackedPanelCollection | |
| 30 // instance to be also destructed since the former owns the later. | |
| 31 virtual void Close() = 0; | |
| 32 | |
| 33 // Called when |panel| is being added to or removed from the stack. | |
| 34 virtual void OnPanelAddedOrRemoved(Panel* panel) = 0; | |
| 35 | |
| 36 // Sets the bounds that is big enough to enclose all panels in the stack. | |
| 37 virtual void SetBounds(const gfx::Rect& bounds) = 0; | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ | |
| OLD | NEW |