51654d41db1423a78fa266294c33d97f45460fab
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / views / app_list / app_list_dialog_contents_view.h
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.
4
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_
7
8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/widget/widget_delegate.h"
10
11 class AppListControllerDelegate;
12
13 namespace views {
14 class LabelButton;
15 class Widget;
16 }
17
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 {
22  public:
23   AppListDialogContentsView(
24       AppListControllerDelegate* app_list_controller_delegate,
25       views::View* dialog_body);
26   virtual ~AppListDialogContentsView();
27
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);
33
34   // Overridden from views::View:
35   virtual void Layout() OVERRIDE;
36
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;
43
44   // Overridden from views::ButtonListener:
45   virtual void ButtonPressed(views::Button* sender,
46                              const ui::Event& event) OVERRIDE;
47
48  protected:
49   // Overridden from views::WidgetDelegate:
50   virtual ui::ModalType GetModalType() const OVERRIDE;
51   virtual ui::AXRole GetAccessibleWindowRole() const OVERRIDE;
52   virtual void WindowClosing() OVERRIDE;
53
54  private:
55   // Weak. Owned by the AppListService singleton.
56   AppListControllerDelegate* app_list_controller_delegate_;
57
58   views::View* dialog_body_;
59   views::LabelButton* close_button_;
60
61   DISALLOW_COPY_AND_ASSIGN(AppListDialogContentsView);
62 };
63
64 #endif  // CHROME_BROWSER_UI_VIEWS_APP_LIST_APP_LIST_DIALOG_CONTENTS_VIEW_H_