| 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 test { | 23 namespace test { |
| 25 class AppListViewTestApi; | 24 class AppListViewTestApi; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 class AppListViewDelegate; | 35 class AppListViewDelegate; |
| 37 class AppListViewObserver; | 36 class AppListViewObserver; |
| 38 class HideViewAnimationObserver; | 37 class HideViewAnimationObserver; |
| 39 class PaginationModel; | 38 class PaginationModel; |
| 40 class SearchBoxView; | 39 class SearchBoxView; |
| 41 class SpeechView; | 40 class SpeechView; |
| 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 given |anchor| plus an |anchor_offset| for | 51 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for |
| 54 // positioning. | 52 // positioning. |
| 55 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, | 53 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, |
| 56 int initial_apps_page, | 54 int initial_apps_page, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 gfx::Size GetPreferredSize() const override; | 102 gfx::Size GetPreferredSize() const override; |
| 105 void OnPaint(gfx::Canvas* canvas) override; | 103 void OnPaint(gfx::Canvas* canvas) override; |
| 106 void OnThemeChanged() override; | 104 void OnThemeChanged() override; |
| 107 | 105 |
| 108 // WidgetDelegate overrides: | 106 // WidgetDelegate overrides: |
| 109 bool ShouldHandleSystemCommands() const override; | 107 bool ShouldHandleSystemCommands() const override; |
| 110 bool ShouldDescendIntoChildForEventHandling( | 108 bool ShouldDescendIntoChildForEventHandling( |
| 111 gfx::NativeView child, | 109 gfx::NativeView child, |
| 112 const gfx::Point& location) override; | 110 const gfx::Point& location) override; |
| 113 | 111 |
| 114 // Overridden from AppListViewDelegateObserver: | |
| 115 void OnProfilesChanged() override; | |
| 116 void OnShutdown() override; | |
| 117 | |
| 118 void Prerender(); | 112 void Prerender(); |
| 119 | 113 |
| 120 void SetProfileByPath(const base::FilePath& profile_path); | |
| 121 | |
| 122 void AddObserver(AppListViewObserver* observer); | 114 void AddObserver(AppListViewObserver* observer); |
| 123 void RemoveObserver(AppListViewObserver* observer); | 115 void RemoveObserver(AppListViewObserver* observer); |
| 124 | 116 |
| 125 // Set a callback to be called the next time any app list paints. | 117 // Set a callback to be called the next time any app list paints. |
| 126 void SetNextPaintCallback(const base::Closure& callback); | 118 void SetNextPaintCallback(const base::Closure& callback); |
| 127 | 119 |
| 128 #if defined(OS_WIN) | 120 #if defined(OS_WIN) |
| 129 HWND GetHWND() const; | 121 HWND GetHWND() const; |
| 130 #endif | 122 #endif |
| 131 | 123 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 181 |
| 190 // For UMA and testing. If non-null, triggered when the app list is painted. | 182 // For UMA and testing. If non-null, triggered when the app list is painted. |
| 191 base::Closure next_paint_callback_; | 183 base::Closure next_paint_callback_; |
| 192 | 184 |
| 193 DISALLOW_COPY_AND_ASSIGN(AppListView); | 185 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 194 }; | 186 }; |
| 195 | 187 |
| 196 } // namespace app_list | 188 } // namespace app_list |
| 197 | 189 |
| 198 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 190 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |