| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 class HideViewAnimationObserver; | 35 class HideViewAnimationObserver; |
| 36 class PaginationModel; | 36 class PaginationModel; |
| 37 class SpeechView; | 37 class SpeechView; |
| 38 | 38 |
| 39 // AppListView is the top-level view and controller of app list UI. It creates | 39 // AppListView is the top-level view and controller of app list UI. It creates |
| 40 // and hosts a AppsGridView and passes AppListModel to it for display. | 40 // and hosts a AppsGridView and passes AppListModel to it for display. |
| 41 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, | 41 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, |
| 42 public AppListViewDelegateObserver, | 42 public AppListViewDelegateObserver, |
| 43 public SpeechUIModelObserver { | 43 public SpeechUIModelObserver { |
| 44 public: | 44 public: |
| 45 // Takes ownership of |delegate|. | 45 // Does not take ownership of |delegate|. |
| 46 explicit AppListView(AppListViewDelegate* delegate); | 46 explicit AppListView(AppListViewDelegate* delegate); |
| 47 virtual ~AppListView(); | 47 virtual ~AppListView(); |
| 48 | 48 |
| 49 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for | 49 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for |
| 50 // positioning. | 50 // positioning. |
| 51 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, | 51 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, |
| 52 int initial_apps_page, | 52 int initial_apps_page, |
| 53 views::View* anchor, | 53 views::View* anchor, |
| 54 const gfx::Vector2d& anchor_offset, | 54 const gfx::Vector2d& anchor_offset, |
| 55 views::BubbleBorder::Arrow arrow, | 55 views::BubbleBorder::Arrow arrow, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 149 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
| 150 virtual void OnWidgetVisibilityChanged( | 150 virtual void OnWidgetVisibilityChanged( |
| 151 views::Widget* widget, bool visible) OVERRIDE; | 151 views::Widget* widget, bool visible) OVERRIDE; |
| 152 virtual void OnWidgetActivationChanged( | 152 virtual void OnWidgetActivationChanged( |
| 153 views::Widget* widget, bool active) OVERRIDE; | 153 views::Widget* widget, bool active) OVERRIDE; |
| 154 | 154 |
| 155 // Overridden from SpeechUIModelObserver: | 155 // Overridden from SpeechUIModelObserver: |
| 156 virtual void OnSpeechRecognitionStateChanged( | 156 virtual void OnSpeechRecognitionStateChanged( |
| 157 SpeechRecognitionState new_state) OVERRIDE; | 157 SpeechRecognitionState new_state) OVERRIDE; |
| 158 | 158 |
| 159 scoped_ptr<AppListViewDelegate> delegate_; | 159 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. |
| 160 | 160 |
| 161 AppListMainView* app_list_main_view_; | 161 AppListMainView* app_list_main_view_; |
| 162 SpeechView* speech_view_; | 162 SpeechView* speech_view_; |
| 163 | 163 |
| 164 // The red "experimental" banner for the experimental app list. | 164 // The red "experimental" banner for the experimental app list. |
| 165 views::ImageView* experimental_banner_view_; | 165 views::ImageView* experimental_banner_view_; |
| 166 | 166 |
| 167 // A semi-transparent white overlay that covers the app list while dialogs are | 167 // A semi-transparent white overlay that covers the app list while dialogs are |
| 168 // open. | 168 // open. |
| 169 views::View* overlay_view_; | 169 views::View* overlay_view_; |
| 170 | 170 |
| 171 ObserverList<AppListViewObserver> observers_; | 171 ObserverList<AppListViewObserver> observers_; |
| 172 scoped_ptr<HideViewAnimationObserver> animation_observer_; | 172 scoped_ptr<HideViewAnimationObserver> animation_observer_; |
| 173 | 173 |
| 174 // For UMA and testing. If non-null, triggered when the app list is painted. | 174 // For UMA and testing. If non-null, triggered when the app list is painted. |
| 175 base::Closure next_paint_callback_; | 175 base::Closure next_paint_callback_; |
| 176 | 176 |
| 177 DISALLOW_COPY_AND_ASSIGN(AppListView); | 177 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace app_list | 180 } // namespace app_list |
| 181 | 181 |
| 182 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 182 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |