| 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 CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 14 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
| 15 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h" | 15 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h" |
| 16 #include "chrome/browser/ui/app_list/start_page_observer.h" |
| 16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 18 #include "ui/app_list/app_list_view_delegate.h" | 19 #include "ui/app_list/app_list_view_delegate.h" |
| 19 | 20 |
| 20 class AppListControllerDelegate; | 21 class AppListControllerDelegate; |
| 21 class ExtensionAppModelBuilder; | 22 class ExtensionAppModelBuilder; |
| 22 class Profile; | 23 class Profile; |
| 23 | 24 |
| 24 namespace app_list { | 25 namespace app_list { |
| 25 class SearchController; | 26 class SearchController; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 | 37 |
| 37 namespace gfx { | 38 namespace gfx { |
| 38 class ImageSkia; | 39 class ImageSkia; |
| 39 } | 40 } |
| 40 | 41 |
| 41 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
| 42 class AppSyncUIStateWatcher; | 43 class AppSyncUIStateWatcher; |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 45 class AppListViewDelegate : public app_list::AppListViewDelegate, | 46 class AppListViewDelegate : public app_list::AppListViewDelegate, |
| 47 public app_list::StartPageObserver, |
| 46 public content::NotificationObserver, | 48 public content::NotificationObserver, |
| 47 public ProfileInfoCacheObserver { | 49 public ProfileInfoCacheObserver { |
| 48 public: | 50 public: |
| 49 // The delegate will take ownership of the controller. | 51 // The delegate will take ownership of the controller. |
| 50 AppListViewDelegate(scoped_ptr<AppListControllerDelegate> controller, | 52 AppListViewDelegate(scoped_ptr<AppListControllerDelegate> controller, |
| 51 Profile* profile); | 53 Profile* profile); |
| 52 virtual ~AppListViewDelegate(); | 54 virtual ~AppListViewDelegate(); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 // Registers the current profile for notifications. | 57 // Registers the current profile for notifications. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 74 virtual void Dismiss() OVERRIDE; | 76 virtual void Dismiss() OVERRIDE; |
| 75 virtual void ViewClosing() OVERRIDE; | 77 virtual void ViewClosing() OVERRIDE; |
| 76 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 78 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
| 77 virtual void OpenSettings() OVERRIDE; | 79 virtual void OpenSettings() OVERRIDE; |
| 78 virtual void OpenHelp() OVERRIDE; | 80 virtual void OpenHelp() OVERRIDE; |
| 79 virtual void OpenFeedback() OVERRIDE; | 81 virtual void OpenFeedback() OVERRIDE; |
| 80 virtual void ShowForProfileByPath( | 82 virtual void ShowForProfileByPath( |
| 81 const base::FilePath& profile_path) OVERRIDE; | 83 const base::FilePath& profile_path) OVERRIDE; |
| 82 virtual content::WebContents* GetStartPageContents() OVERRIDE; | 84 virtual content::WebContents* GetStartPageContents() OVERRIDE; |
| 83 | 85 |
| 86 // Overridden from app_list::StartPageObserver: |
| 87 virtual void OnSearch(const base::string16& query) OVERRIDE; |
| 88 |
| 84 // Overridden from content::NotificationObserver: | 89 // Overridden from content::NotificationObserver: |
| 85 virtual void Observe(int type, | 90 virtual void Observe(int type, |
| 86 const content::NotificationSource& source, | 91 const content::NotificationSource& source, |
| 87 const content::NotificationDetails& details) OVERRIDE; | 92 const content::NotificationDetails& details) OVERRIDE; |
| 88 | 93 |
| 89 // Overridden from ProfileInfoCacheObserver: | 94 // Overridden from ProfileInfoCacheObserver: |
| 90 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; | 95 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; |
| 91 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, | 96 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, |
| 92 const base::string16& profile_name) OVERRIDE; | 97 const base::string16& profile_name) OVERRIDE; |
| 93 virtual void OnProfileNameChanged( | 98 virtual void OnProfileNameChanged( |
| 94 const base::FilePath& profile_path, | 99 const base::FilePath& profile_path, |
| 95 const base::string16& old_profile_name) OVERRIDE; | 100 const base::string16& old_profile_name) OVERRIDE; |
| 96 | 101 |
| 97 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; | 102 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; |
| 98 scoped_ptr<app_list::SearchController> search_controller_; | 103 scoped_ptr<app_list::SearchController> search_controller_; |
| 99 scoped_ptr<AppListControllerDelegate> controller_; | 104 scoped_ptr<AppListControllerDelegate> controller_; |
| 100 Profile* profile_; | 105 Profile* profile_; |
| 101 app_list::AppListModel* model_; // Weak. Owned by AppListView. | 106 app_list::AppListModel* model_; // Weak. Owned by AppListView. |
| 102 | 107 |
| 103 content::NotificationRegistrar registrar_; | 108 content::NotificationRegistrar registrar_; |
| 104 ChromeSigninDelegate signin_delegate_; | 109 ChromeSigninDelegate signin_delegate_; |
| 105 #if defined(USE_ASH) | 110 #if defined(USE_ASH) |
| 106 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; | 111 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; |
| 107 #endif | 112 #endif |
| 108 | 113 |
| 109 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | 114 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
| 110 }; | 115 }; |
| 111 | 116 |
| 112 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 117 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| OLD | NEW |