OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ui/app_list/app_list_export.h" | 14 #include "ui/app_list/app_list_export.h" |
15 #include "ui/app_list/app_list_view_delegate_observer.h" | |
16 #include "ui/app_list/speech_ui_model_observer.h" | 15 #include "ui/app_list/speech_ui_model_observer.h" |
17 #include "ui/views/bubble/bubble_dialog_delegate.h" | 16 #include "ui/views/bubble/bubble_dialog_delegate.h" |
18 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
19 | 18 |
20 namespace base { | 19 namespace base { |
21 class FilePath; | 20 class FilePath; |
22 } | 21 } |
23 | 22 |
24 namespace views { | 23 namespace views { |
25 class ImageView; | 24 class ImageView; |
(...skipping 10 matching lines...) Expand all Loading... |
36 class SearchBoxView; | 35 class SearchBoxView; |
37 class SpeechView; | 36 class SpeechView; |
38 | 37 |
39 namespace test { | 38 namespace test { |
40 class AppListViewTestApi; | 39 class AppListViewTestApi; |
41 } | 40 } |
42 | 41 |
43 // AppListView is the top-level view and controller of app list UI. It creates | 42 // AppListView is the top-level view and controller of app list UI. It creates |
44 // and hosts a AppsGridView and passes AppListModel to it for display. | 43 // and hosts a AppsGridView and passes AppListModel to it for display. |
45 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 44 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
46 public AppListViewDelegateObserver, | |
47 public SpeechUIModelObserver { | 45 public SpeechUIModelObserver { |
48 public: | 46 public: |
49 // Does not take ownership of |delegate|. | 47 // Does not take ownership of |delegate|. |
50 explicit AppListView(AppListViewDelegate* delegate); | 48 explicit AppListView(AppListViewDelegate* delegate); |
51 ~AppListView() override; | 49 ~AppListView() override; |
52 | 50 |
53 // Initializes the widget and use a fixed |anchor_point_in_screen| for | 51 // Initializes the widget and use a fixed |anchor_point_in_screen| for |
54 // positioning. | 52 // positioning. |
55 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, | 53 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, |
56 int initial_apps_page, | 54 int initial_apps_page, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Overridden from views::View: | 89 // Overridden from views::View: |
92 gfx::Size GetPreferredSize() const override; | 90 gfx::Size GetPreferredSize() const override; |
93 void OnPaint(gfx::Canvas* canvas) override; | 91 void OnPaint(gfx::Canvas* canvas) override; |
94 | 92 |
95 // WidgetDelegate overrides: | 93 // WidgetDelegate overrides: |
96 bool ShouldHandleSystemCommands() const override; | 94 bool ShouldHandleSystemCommands() const override; |
97 bool ShouldDescendIntoChildForEventHandling( | 95 bool ShouldDescendIntoChildForEventHandling( |
98 gfx::NativeView child, | 96 gfx::NativeView child, |
99 const gfx::Point& location) override; | 97 const gfx::Point& location) override; |
100 | 98 |
101 // Overridden from AppListViewDelegateObserver: | |
102 void OnShutdown() override; | |
103 | |
104 void SetProfileByPath(const base::FilePath& profile_path); | 99 void SetProfileByPath(const base::FilePath& profile_path); |
105 | 100 |
106 void AddObserver(AppListViewObserver* observer); | 101 void AddObserver(AppListViewObserver* observer); |
107 void RemoveObserver(AppListViewObserver* observer); | 102 void RemoveObserver(AppListViewObserver* observer); |
108 | 103 |
109 AppListMainView* app_list_main_view() { return app_list_main_view_; } | 104 AppListMainView* app_list_main_view() { return app_list_main_view_; } |
110 | 105 |
111 // Gets the PaginationModel owned by this view's apps grid. | 106 // Gets the PaginationModel owned by this view's apps grid. |
112 PaginationModel* GetAppsPaginationModel(); | 107 PaginationModel* GetAppsPaginationModel(); |
113 | 108 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 161 |
167 // For UMA and testing. If non-null, triggered when the app list is painted. | 162 // For UMA and testing. If non-null, triggered when the app list is painted. |
168 base::Closure next_paint_callback_; | 163 base::Closure next_paint_callback_; |
169 | 164 |
170 DISALLOW_COPY_AND_ASSIGN(AppListView); | 165 DISALLOW_COPY_AND_ASSIGN(AppListView); |
171 }; | 166 }; |
172 | 167 |
173 } // namespace app_list | 168 } // namespace app_list |
174 | 169 |
175 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 170 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
OLD | NEW |