blob: a146308f21a395553352ec031199801b63679489 [file] [log] [blame]
// 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.
#include "base/macros.h"
#include "ui/aura/aura_export.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
namespace ash {
class PanelFrameView;
// 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 {
explicit PanelWindow(const std::string& name);
~PanelWindow() override;
// 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);
// Overridden from views::View:
gfx::Size GetPreferredSize() const override;
void OnPaint(gfx::Canvas* canvas) override;
// Overridden from views::WidgetDelegate:
base::string16 GetWindowTitle() const override;
View* GetContentsView() override;
bool CanResize() const override;
bool CanMaximize() const override;
bool CanMinimize() const override;
views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) override;
std::string name_;
views::Widget::InitParams params_;
} // namespace ash