1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTAINER_H_
6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTAINER_H_
8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/window/dialog_delegate.h"
16 // The contents view for an App List Dialog, which covers the entire app list
17 // and adds a close button.
18 class AppListDialogContainer : public views::DialogDelegateView,
19 public views::ButtonListener {
21 // Creates a new AppListDialogContainer. Takes ownership of |dialog_body|.
22 AppListDialogContainer(views::View* dialog_body,
23 const base::Closure& close_callback);
24 virtual ~AppListDialogContainer();
26 // Overridden from views::View:
27 virtual void Layout() OVERRIDE;
29 // Overridden from views::WidgetDelegate:
30 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
31 virtual views::View* GetContentsView() OVERRIDE;
32 virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE;
33 virtual views::NonClientFrameView* CreateNonClientFrameView(
34 views::Widget* widget) OVERRIDE;
36 // Overridden from views::ButtonListener:
37 virtual void ButtonPressed(views::Button* sender,
38 const ui::Event& event) OVERRIDE;
41 // Overridden from views::WidgetDelegate:
42 virtual ui::ModalType GetModalType() const OVERRIDE;
43 virtual void WindowClosing() OVERRIDE;
46 views::View* dialog_body_; // Owned by this class via the views hierarchy.
47 const base::Closure close_callback_;
49 views::LabelButton* close_button_;
51 DISALLOW_COPY_AND_ASSIGN(AppListDialogContainer);
54 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTAINER_H_