| 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" | |
| 22 #include "chrome/browser/extensions/extension_prefs.h" | 21 #include "chrome/browser/extensions/extension_prefs.h" |
| 23 #include "chrome/browser/prefs/pref_service_observer.h" | 22 #include "chrome/browser/prefs/pref_service_observer.h" |
| 24 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 23 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.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; |
| 31 class BrowserLauncherItemControllerTest; | 30 class BrowserLauncherItemControllerTest; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, | 50 // * Tabbed browsers and browser app windows have BrowserLauncherItemController, |
| 52 // owned by the BrowserView instance. | 51 // owned by the BrowserView instance. |
| 53 // * App shell windows have ShellWindowLauncherItemController, owned by | 52 // * App shell windows have ShellWindowLauncherItemController, owned by |
| 54 // ShellWindowLauncherController. | 53 // ShellWindowLauncherController. |
| 55 // * Shortcuts have no LauncherItemController. | 54 // * Shortcuts have no LauncherItemController. |
| 56 class ChromeLauncherController | 55 class ChromeLauncherController |
| 57 : public ash::LauncherDelegate, | 56 : public ash::LauncherDelegate, |
| 58 public ash::LauncherModelObserver, | 57 public ash::LauncherModelObserver, |
| 59 public ash::ShellObserver, | 58 public ash::ShellObserver, |
| 60 public content::NotificationObserver, | 59 public content::NotificationObserver, |
| 61 public PrefObserver, | |
| 62 public PrefServiceObserver, | 60 public PrefServiceObserver, |
| 63 public AppSyncUIStateObserver { | 61 public AppSyncUIStateObserver { |
| 64 public: | 62 public: |
| 65 // Indicates if a launcher item is incognito or not. | 63 // Indicates if a launcher item is incognito or not. |
| 66 enum IncognitoState { | 64 enum IncognitoState { |
| 67 STATE_INCOGNITO, | 65 STATE_INCOGNITO, |
| 68 STATE_NOT_INCOGNITO, | 66 STATE_NOT_INCOGNITO, |
| 69 }; | 67 }; |
| 70 | 68 |
| 71 // 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... |
| 260 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; | 258 virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; |
| 261 virtual void LauncherItemChanged(int index, | 259 virtual void LauncherItemChanged(int index, |
| 262 const ash::LauncherItem& old_item) OVERRIDE; | 260 const ash::LauncherItem& old_item) OVERRIDE; |
| 263 virtual void LauncherStatusChanged() OVERRIDE; | 261 virtual void LauncherStatusChanged() OVERRIDE; |
| 264 | 262 |
| 265 // Overridden from content::NotificationObserver: | 263 // Overridden from content::NotificationObserver: |
| 266 virtual void Observe(int type, | 264 virtual void Observe(int type, |
| 267 const content::NotificationSource& source, | 265 const content::NotificationSource& source, |
| 268 const content::NotificationDetails& details) OVERRIDE; | 266 const content::NotificationDetails& details) OVERRIDE; |
| 269 | 267 |
| 270 // Overridden from PrefObserver: | |
| 271 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
| 272 const std::string& pref_name) OVERRIDE; | |
| 273 | |
| 274 // Overridden from ash::ShellObserver: | 268 // Overridden from ash::ShellObserver: |
| 275 virtual void OnShelfAlignmentChanged() OVERRIDE; | 269 virtual void OnShelfAlignmentChanged() OVERRIDE; |
| 276 | 270 |
| 277 // Overridden from PrefServiceObserver: | 271 // Overridden from PrefServiceObserver: |
| 278 virtual void OnIsSyncingChanged() OVERRIDE; | 272 virtual void OnIsSyncingChanged() OVERRIDE; |
| 279 | 273 |
| 280 // Overridden from AppSyncUIStateObserver | 274 // Overridden from AppSyncUIStateObserver |
| 281 virtual void OnAppSyncUIStatusChanged() OVERRIDE; | 275 virtual void OnAppSyncUIStatusChanged() OVERRIDE; |
| 282 | 276 |
| 283 private: | 277 private: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 content::NotificationRegistrar notification_registrar_; | 357 content::NotificationRegistrar notification_registrar_; |
| 364 | 358 |
| 365 PrefChangeRegistrar pref_change_registrar_; | 359 PrefChangeRegistrar pref_change_registrar_; |
| 366 | 360 |
| 367 AppSyncUIState* app_sync_ui_state_; | 361 AppSyncUIState* app_sync_ui_state_; |
| 368 | 362 |
| 369 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 363 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 370 }; | 364 }; |
| 371 | 365 |
| 372 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 366 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |