Index: chrome/browser/ui/panels/native_panel_stack.h |
diff --git a/chrome/browser/ui/panels/native_panel_stack.h b/chrome/browser/ui/panels/native_panel_stack.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3b93c0a0a9f89ac36453a82aa65c0b105bdf0985 |
--- /dev/null |
+++ b/chrome/browser/ui/panels/native_panel_stack.h |
@@ -0,0 +1,40 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |
+#define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |
+ |
+class Panel; |
+class StackedPanelCollection; |
+namespace gfx { |
+class Rect; |
+} |
+ |
+// An interface that encapsulates the platform-specific behaviors that are |
+// needed to support multiple panels that are stacked together. A native |
+// window might be created to enclose all the panels in the stack. The lifetime |
+// of the class that implements this interface is managed by itself. |
+class NativePanelStack { |
+ 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.
|
+ |
+ public: |
+ // The StackedPanelCollection instance is passed and owned by the |
+ // NativePanelStack instance that is being created. |
+ 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
|
+ virtual ~NativePanelStack() {} |
+ |
+ protected: |
+ // Called when the stack is to be closed. This will destruct the |
+ // NativePanelStack instance which causes the StackedPanelCollection |
+ // instance to be also destructed since the former owns the later. |
+ virtual void Close() = 0; |
+ |
+ // Called when |panel| is being added to or removed from the stack. |
+ virtual void OnPanelAddedOrRemoved(Panel* panel) = 0; |
+ |
+ // Sets the bounds that is big enough to enclose all panels in the stack. |
+ virtual void SetBounds(const gfx::Rect& bounds) = 0; |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_H_ |