| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "ui/app_list/app_list_export.h" | 10 #include "ui/app_list/app_list_export.h" |
| 11 #include "ui/app_list/signin_delegate_observer.h" | 11 #include "ui/app_list/app_list_model_observer.h" |
| 12 #include "ui/views/bubble/bubble_delegate.h" | 12 #include "ui/views/bubble/bubble_delegate.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class Widget; | 15 class Widget; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace app_list { | 18 namespace app_list { |
| 19 class ApplicationDragAndDropHost; | 19 class ApplicationDragAndDropHost; |
| 20 class AppListMainView; | 20 class AppListMainView; |
| 21 class AppListModel; | 21 class AppListModel; |
| 22 class AppListViewDelegate; | 22 class AppListViewDelegate; |
| 23 class PaginationModel; | 23 class PaginationModel; |
| 24 class SigninDelegate; | 24 class SigninDelegate; |
| 25 class SigninView; | 25 class SigninView; |
| 26 | 26 |
| 27 // AppListView is the top-level view and controller of app list UI. It creates | 27 // AppListView is the top-level view and controller of app list UI. It creates |
| 28 // and hosts a AppsGridView and passes AppListModel to it for display. | 28 // and hosts a AppsGridView and passes AppListModel to it for display. |
| 29 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, | 29 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, |
| 30 public SigninDelegateObserver { | 30 public AppListModelObserver { |
| 31 public: | 31 public: |
| 32 class Observer { | 32 class Observer { |
| 33 public: | 33 public: |
| 34 virtual void OnActivationChanged(views::Widget* widget, bool active) = 0; | 34 virtual void OnActivationChanged(views::Widget* widget, bool active) = 0; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 // Takes ownership of |delegate|. | 37 // Takes ownership of |delegate|. |
| 38 explicit AppListView(AppListViewDelegate* delegate); | 38 explicit AppListView(AppListViewDelegate* delegate); |
| 39 virtual ~AppListView(); | 39 virtual ~AppListView(); |
| 40 | 40 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 94 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 95 virtual void Layout() OVERRIDE; | 95 virtual void Layout() OVERRIDE; |
| 96 | 96 |
| 97 // Overridden from views::WidgetObserver: | 97 // Overridden from views::WidgetObserver: |
| 98 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 98 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
| 99 virtual void OnWidgetVisibilityChanged( | 99 virtual void OnWidgetVisibilityChanged( |
| 100 views::Widget* widget, bool visible) OVERRIDE; | 100 views::Widget* widget, bool visible) OVERRIDE; |
| 101 virtual void OnWidgetActivationChanged( | 101 virtual void OnWidgetActivationChanged( |
| 102 views::Widget* widget, bool active) OVERRIDE; | 102 views::Widget* widget, bool active) OVERRIDE; |
| 103 | 103 |
| 104 // Overridden from SigninDelegateObserver: | 104 // Overridden from AppListModelObserver: |
| 105 virtual void OnSigninSuccess() OVERRIDE; | 105 virtual void OnAppListModelSigninStatusChanged() OVERRIDE; |
| 106 virtual void OnAppListModelCurrentUserChanged() OVERRIDE; |
| 106 | 107 |
| 107 SigninDelegate* GetSigninDelegate(); | 108 SigninDelegate* GetSigninDelegate(); |
| 108 | 109 |
| 109 scoped_ptr<AppListModel> model_; | 110 scoped_ptr<AppListModel> model_; |
| 110 scoped_ptr<AppListViewDelegate> delegate_; | 111 scoped_ptr<AppListViewDelegate> delegate_; |
| 111 | 112 |
| 112 AppListMainView* app_list_main_view_; | 113 AppListMainView* app_list_main_view_; |
| 113 SigninView* signin_view_; | 114 SigninView* signin_view_; |
| 114 | 115 |
| 115 ObserverList<Observer> observers_; | 116 ObserverList<Observer> observers_; |
| 116 | 117 |
| 117 DISALLOW_COPY_AND_ASSIGN(AppListView); | 118 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace app_list | 121 } // namespace app_list |
| 121 | 122 |
| 122 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 123 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |