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