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_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "ash/launcher/launcher_model_observer.h" | 12 #include "ash/launcher/launcher_model_observer.h" |
13 #include "ash/launcher/launcher_types.h" | 13 #include "ash/launcher/launcher_types.h" |
14 #include "ash/shell_observer.h" | 14 #include "ash/shell_observer.h" |
15 #include "ash/wm/shelf_types.h" | 15 #include "ash/wm/shelf_types.h" |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/prefs/public/pref_change_registrar.h" | 19 #include "base/prefs/public/pref_change_registrar.h" |
20 #include "base/prefs/public/pref_observer.h" | |
21 #include "chrome/browser/extensions/extension_prefs.h" | 20 #include "chrome/browser/extensions/extension_prefs.h" |
22 #include "chrome/browser/prefs/pref_service_observer.h" | 21 #include "chrome/browser/prefs/pref_service_observer.h" |
23 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 22 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" |
24 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 23 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
25 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
26 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
27 #include "ui/aura/window_observer.h" | 26 #include "ui/aura/window_observer.h" |
28 | 27 |
29 class AppSyncUIState; | 28 class AppSyncUIState; |
30 class Browser; | 29 class Browser; |
(...skipping 22 matching lines...) Expand all Loading... |
53 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, | 52 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, |
54 // owned by the BrowserView instance. | 53 // owned by the BrowserView instance. |
55 // * App shell windows have ShellWindowLauncherItemController, owned by | 54 // * App shell windows have ShellWindowLauncherItemController, owned by |
56 // ShellWindowLauncherController. | 55 // ShellWindowLauncherController. |
57 // * Shortcuts have no LauncherItemController. | 56 // * Shortcuts have no LauncherItemController. |
58 class ChromeLauncherControllerPerApp | 57 class ChromeLauncherControllerPerApp |
59 : public ash::LauncherModelObserver, | 58 : public ash::LauncherModelObserver, |
60 public ash::ShellObserver, | 59 public ash::ShellObserver, |
61 public ChromeLauncherController, | 60 public ChromeLauncherController, |
62 public content::NotificationObserver, | 61 public content::NotificationObserver, |
63 public PrefObserver, | |
64 public PrefServiceObserver, | 62 public PrefServiceObserver, |
65 public AppSyncUIStateObserver { | 63 public AppSyncUIStateObserver { |
66 public: | 64 public: |
67 ChromeLauncherControllerPerApp(Profile* profile, ash::LauncherModel* model); | 65 ChromeLauncherControllerPerApp(Profile* profile, ash::LauncherModel* model); |
68 virtual ~ChromeLauncherControllerPerApp(); | 66 virtual ~ChromeLauncherControllerPerApp(); |
69 | 67 |
70 // ChromeLauncherController overrides: | 68 // ChromeLauncherController overrides: |
71 | 69 |
72 // Initializes this ChromeLauncherControllerPerApp. | 70 // Initializes this ChromeLauncherControllerPerApp. |
73 virtual void Init() OVERRIDE; | 71 virtual void Init() OVERRIDE; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; | 226 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; |
229 virtual void LauncherItemChanged(int index, | 227 virtual void LauncherItemChanged(int index, |
230 const ash::LauncherItem& old_item) OVERRIDE; | 228 const ash::LauncherItem& old_item) OVERRIDE; |
231 virtual void LauncherStatusChanged() OVERRIDE; | 229 virtual void LauncherStatusChanged() OVERRIDE; |
232 | 230 |
233 // Overridden from content::NotificationObserver: | 231 // Overridden from content::NotificationObserver: |
234 virtual void Observe(int type, | 232 virtual void Observe(int type, |
235 const content::NotificationSource& source, | 233 const content::NotificationSource& source, |
236 const content::NotificationDetails& details) OVERRIDE; | 234 const content::NotificationDetails& details) OVERRIDE; |
237 | 235 |
238 // Overridden from PrefObserver: | |
239 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
240 const std::string& pref_name) OVERRIDE; | |
241 | |
242 // Overridden from ash::ShellObserver: | 236 // Overridden from ash::ShellObserver: |
243 virtual void OnShelfAlignmentChanged() OVERRIDE; | 237 virtual void OnShelfAlignmentChanged() OVERRIDE; |
244 | 238 |
245 // Overridden from PrefServiceObserver: | 239 // Overridden from PrefServiceObserver: |
246 virtual void OnIsSyncingChanged() OVERRIDE; | 240 virtual void OnIsSyncingChanged() OVERRIDE; |
247 | 241 |
248 // Overridden from AppSyncUIStateObserver | 242 // Overridden from AppSyncUIStateObserver |
249 virtual void OnAppSyncUIStatusChanged() OVERRIDE; | 243 virtual void OnAppSyncUIStatusChanged() OVERRIDE; |
250 | 244 |
251 protected: | 245 protected: |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 content::NotificationRegistrar notification_registrar_; | 326 content::NotificationRegistrar notification_registrar_; |
333 | 327 |
334 PrefChangeRegistrar pref_change_registrar_; | 328 PrefChangeRegistrar pref_change_registrar_; |
335 | 329 |
336 AppSyncUIState* app_sync_ui_state_; | 330 AppSyncUIState* app_sync_ui_state_; |
337 | 331 |
338 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerPerApp); | 332 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerPerApp); |
339 }; | 333 }; |
340 | 334 |
341 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ | 335 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_PER_APP_H_ |
OLD | NEW |