summaryrefslogtreecommitdiffstats
path: root/ash/shell/panel_window.h
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 16:44:27 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 16:44:27 +0000
commit6b85493985ec994cd82977ea088bb7a3de955a66 (patch)
tree6824605dce0d1118ae77600a4f18f5c37626aa9d /ash/shell/panel_window.h
parent83b583eee2d88a6a79f30073e83ed6a5e0ae3fc5 (diff)
downloadchromium_src-6b85493985ec994cd82977ea088bb7a3de955a66.zip
chromium_src-6b85493985ec994cd82977ea088bb7a3de955a66.tar.gz
chromium_src-6b85493985ec994cd82977ea088bb7a3de955a66.tar.bz2
Add PanelWindow and PanelLayoutManager to ash. (+ win fix)
This implements a sample implementation of a WidgetDelegateView (PanelWindow) and a LayoutManager to provide an initial out ash_shell must be run with --aura-panels to get the new behavior, since Chrome currently relies on existing behavior for wi BUG=98330 TEST=Run ash_shell --aura-panels to see a simple panel test implementation. Ensure panels work as expected in Chrome. Original Review URL: http://codereview.chromium.org/9104027 TBR=dslomov@chromium.org Review URL: http://codereview.chromium.org/9325051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell/panel_window.h')
-rw-r--r--ash/shell/panel_window.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/ash/shell/panel_window.h b/ash/shell/panel_window.h
new file mode 100644
index 0000000..cc1afbd
--- /dev/null
+++ b/ash/shell/panel_window.h
@@ -0,0 +1,53 @@
+// 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 ASH_SHELL_PANEL_WINDOW_H_
+#define ASH_SHELL_PANEL_WINDOW_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "ui/aura/aura_export.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
+
+namespace ash {
+
+// Example Class for panel windows (Widget::InitParams::TYPE_PANEL).
+// Instances of PanelWindow will get added to the PanelContainer top level
+// window which manages the panel layout through PanelLayoutManager.
+class PanelWindow : public views::WidgetDelegateView {
+ public:
+ explicit PanelWindow(const std::string& name);
+ virtual ~PanelWindow();
+
+ // Creates the widget for the panel window using |params_|.
+ views::Widget* CreateWidget();
+
+ const std::string& name() { return name_; }
+ views::Widget::InitParams& params() { return params_; }
+
+ // Creates a panel window and returns the associated widget.
+ static views::Widget* CreatePanelWindow(const gfx::Rect& rect);
+
+ private:
+ // Overridden from views::View:
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+
+ // Overridden from views::WidgetDelegate:
+ virtual string16 GetWindowTitle() const OVERRIDE;
+ virtual View* GetContentsView() OVERRIDE;
+ virtual bool CanResize() const OVERRIDE;
+ virtual bool CanMaximize() const OVERRIDE;
+ virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
+
+ std::string name_;
+ views::Widget::InitParams params_;
+
+ DISALLOW_COPY_AND_ASSIGN(PanelWindow);
+};
+
+} // namespace ash
+
+#endif // ASH_SHELL_PANEL_WINDOW_H_