| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_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_delegate.h" | 12 #include "ash/launcher/launcher_delegate.h" |
| 13 #include "ash/launcher/launcher_model_observer.h" | 13 #include "ash/launcher/launcher_model_observer.h" |
| 14 #include "ash/launcher/launcher_types.h" | 14 #include "ash/launcher/launcher_types.h" |
| 15 #include "ash/shell_observer.h" | 15 #include "ash/shell_observer.h" |
| 16 #include "ash/wm/shelf_types.h" | 16 #include "ash/wm/shelf_types.h" |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/prefs/public/pref_change_registrar.h" | 20 #include "base/prefs/public/pref_change_registrar.h" |
| 21 #include "base/prefs/public/pref_observer.h" |
| 21 #include "base/timer.h" | 22 #include "base/timer.h" |
| 22 #include "chrome/browser/api/sync/profile_sync_service_observer.h" | 23 #include "chrome/browser/api/sync/profile_sync_service_observer.h" |
| 23 #include "chrome/browser/prefs/pref_service_observer.h" | 24 #include "chrome/browser/prefs/pref_service_observer.h" |
| 24 #include "chrome/browser/extensions/extension_prefs.h" | 25 #include "chrome/browser/extensions/extension_prefs.h" |
| 25 #include "content/public/browser/notification_observer.h" | 26 #include "content/public/browser/notification_observer.h" |
| 26 #include "content/public/browser/notification_registrar.h" | 27 #include "content/public/browser/notification_registrar.h" |
| 27 #include "ui/aura/window_observer.h" | 28 #include "ui/aura/window_observer.h" |
| 28 | 29 |
| 29 namespace ash { | 30 namespace ash { |
| 30 class LauncherModel; | 31 class LauncherModel; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 48 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, | 49 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, |
| 49 // owned by the BrowserView instance. | 50 // owned by the BrowserView instance. |
| 50 // * App shell windows have ShellWindowLauncherItemController, owned by | 51 // * App shell windows have ShellWindowLauncherItemController, owned by |
| 51 // ShellWindowLauncherController. | 52 // ShellWindowLauncherController. |
| 52 // * Shortcuts have no LauncherItemController. | 53 // * Shortcuts have no LauncherItemController. |
| 53 class ChromeLauncherController | 54 class ChromeLauncherController |
| 54 : public ash::LauncherDelegate, | 55 : public ash::LauncherDelegate, |
| 55 public ash::LauncherModelObserver, | 56 public ash::LauncherModelObserver, |
| 56 public ash::ShellObserver, | 57 public ash::ShellObserver, |
| 57 public content::NotificationObserver, | 58 public content::NotificationObserver, |
| 59 public PrefObserver, |
| 58 public ProfileSyncServiceObserver, | 60 public ProfileSyncServiceObserver, |
| 59 public PrefServiceObserver { | 61 public PrefServiceObserver { |
| 60 public: | 62 public: |
| 61 // Indicates if a launcher item is incognito or not. | 63 // Indicates if a launcher item is incognito or not. |
| 62 enum IncognitoState { | 64 enum IncognitoState { |
| 63 STATE_INCOGNITO, | 65 STATE_INCOGNITO, |
| 64 STATE_NOT_INCOGNITO, | 66 STATE_NOT_INCOGNITO, |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 // Used to update the state of non plaform apps, as tab contents change. | 69 // Used to update the state of non plaform apps, as tab contents change. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; | 258 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; |
| 257 virtual void LauncherItemChanged(int index, | 259 virtual void LauncherItemChanged(int index, |
| 258 const ash::LauncherItem& old_item) OVERRIDE; | 260 const ash::LauncherItem& old_item) OVERRIDE; |
| 259 virtual void LauncherStatusChanged() OVERRIDE; | 261 virtual void LauncherStatusChanged() OVERRIDE; |
| 260 | 262 |
| 261 // Overridden from content::NotificationObserver: | 263 // Overridden from content::NotificationObserver: |
| 262 virtual void Observe(int type, | 264 virtual void Observe(int type, |
| 263 const content::NotificationSource& source, | 265 const content::NotificationSource& source, |
| 264 const content::NotificationDetails& details) OVERRIDE; | 266 const content::NotificationDetails& details) OVERRIDE; |
| 265 | 267 |
| 268 // Overridden from PrefObserver: |
| 269 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 270 const std::string& pref_name) OVERRIDE; |
| 271 |
| 266 // Overridden from ash::ShellObserver: | 272 // Overridden from ash::ShellObserver: |
| 267 virtual void OnShelfAlignmentChanged() OVERRIDE; | 273 virtual void OnShelfAlignmentChanged() OVERRIDE; |
| 268 | 274 |
| 269 // Overridden from ProfileSyncServiceObserver: | 275 // Overridden from ProfileSyncServiceObserver: |
| 270 virtual void OnStateChanged() OVERRIDE; | 276 virtual void OnStateChanged() OVERRIDE; |
| 271 | 277 |
| 272 // Overriden from PrefServiceObserver: | 278 // Overriden from PrefServiceObserver: |
| 273 virtual void OnIsSyncingChanged() OVERRIDE; | 279 virtual void OnIsSyncingChanged() OVERRIDE; |
| 274 | 280 |
| 275 private: | 281 private: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 371 |
| 366 PrefChangeRegistrar pref_change_registrar_; | 372 PrefChangeRegistrar pref_change_registrar_; |
| 367 | 373 |
| 368 ProfileSyncService* observed_sync_service_; | 374 ProfileSyncService* observed_sync_service_; |
| 369 base::OneShotTimer<ChromeLauncherController> loading_timer_; | 375 base::OneShotTimer<ChromeLauncherController> loading_timer_; |
| 370 | 376 |
| 371 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 377 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 372 }; | 378 }; |
| 373 | 379 |
| 374 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 380 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |