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_CONTENTS_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTENTS_VIEW_H_
8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/widget/widget_delegate.h"
11 class AppListControllerDelegate;
18 // The contents view for an App List Dialog, which covers the entire app list
19 // and adds a close button.
20 class AppListDialogContentsView : public views::WidgetDelegateView,
21 public views::ButtonListener {
23 AppListDialogContentsView(
24 AppListControllerDelegate* app_list_controller_delegate,
25 views::View* dialog_body);
26 virtual ~AppListDialogContentsView();
28 // Create a |dialog| window Widget with the specified |parent|. The dialog
29 // will be resized to fill the body of the app list.
30 static views::Widget* CreateDialogWidget(gfx::NativeWindow parent,
31 const gfx::Rect& bounds,
32 AppListDialogContentsView* dialog);
34 // Overridden from views::View:
35 virtual void Layout() OVERRIDE;
37 // Overridden from views::WidgetDelegate:
38 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
39 virtual views::View* GetContentsView() OVERRIDE;
40 virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE;
41 virtual views::NonClientFrameView* CreateNonClientFrameView(
42 views::Widget* widget) OVERRIDE;
44 // Overridden from views::ButtonListener:
45 virtual void ButtonPressed(views::Button* sender,
46 const ui::Event& event) OVERRIDE;
49 // Overridden from views::WidgetDelegate:
50 virtual ui::ModalType GetModalType() const OVERRIDE;
51 virtual ui::AXRole GetAccessibleWindowRole() const OVERRIDE;
52 virtual void WindowClosing() OVERRIDE;
55 // Weak. Owned by the AppListService singleton.
56 AppListControllerDelegate* app_list_controller_delegate_;
58 views::View* dialog_body_;
59 views::LabelButton* close_button_;
61 DISALLOW_COPY_AND_ASSIGN(AppListDialogContentsView);
64 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTENTS_VIEW_H_