Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller.h |
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h |
index 2e9fb23c7085e4e091fbcc0886cd41877cf4d665..188922e8ef5b55f1771b6430063101ebf1235d7d 100644 |
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h |
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
#define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
+#include <deque> |
#include <list> |
#include <map> |
#include <string> |
@@ -17,9 +18,11 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/timer.h" |
#include "chrome/browser/extensions/extension_prefs.h" |
#include "chrome/browser/extensions/shell_window_registry.h" |
#include "chrome/browser/prefs/pref_change_registrar.h" |
+#include "chrome/browser/sync/profile_sync_service_observer.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
#include "ui/aura/client/activation_change_observer.h" |
@@ -42,6 +45,7 @@ class BrowserLauncherItemController; |
class BrowserLauncherItemControllerTest; |
class PrefService; |
class Profile; |
+class ProfileSyncService; |
class TabContents; |
// ChromeLauncherController manages the launcher items needed for tabbed |
@@ -53,7 +57,8 @@ class ChromeLauncherController |
public content::NotificationObserver, |
public ShellWindowRegistry::Observer, |
public aura::client::ActivationChangeObserver, |
- public aura::WindowObserver { |
+ public aura::WindowObserver, |
+ public ProfileSyncServiceObserver { |
public: |
// Indicates if a launcher item is incognito or not. |
enum IncognitoState { |
@@ -236,17 +241,20 @@ class ChromeLauncherController |
virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE; |
virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE; |
- // Overriden from client::ActivationChangeObserver: |
+ // Overridden from client::ActivationChangeObserver: |
virtual void OnWindowActivated( |
aura::Window* active, |
aura::Window* old_active) OVERRIDE; |
- // Overriden from aura::WindowObserver: |
+ // Overridden from aura::WindowObserver: |
virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE; |
- // Overriden from ash::ShellObserver: |
+ // Overridden from ash::ShellObserver: |
virtual void OnShelfAlignmentChanged() OVERRIDE; |
+ // Overridden from ProfileSyncServiceObserver: |
+ virtual void OnStateChanged() OVERRIDE; |
+ |
private: |
friend class BrowserLauncherItemControllerTest; |
friend class ChromeLauncherControllerTest; |
@@ -290,10 +298,6 @@ class ChromeLauncherController |
// Returns item status for given |id|. |
ash::LauncherItemStatus GetItemStatus(ash::LauncherID id) const; |
- // Finds the launcher item that represents given |app_id| and updates the |
- // pending state. |
- void MarkAppPending(const std::string& app_id); |
- |
// Internal helpers for pinning and unpinning that handle both |
// client-triggered and internal pinning operations. |
void DoPinAppWithID(const std::string& app_id); |
@@ -319,6 +323,13 @@ class ChromeLauncherController |
ash::LauncherItemStatus status, |
int index); |
+ // Checks whether sync is completed and no pending synced extension install. |
+ // Stops loading UI when both conditions are met. |
+ void CheckAppSync(); |
+ |
+ void StartLoadingUI(); |
+ void StopLoadingUI(); |
+ |
static ChromeLauncherController* instance_; |
ash::LauncherModel* model_; |
@@ -354,6 +365,10 @@ class ChromeLauncherController |
PrefChangeRegistrar pref_change_registrar_; |
aura::client::ActivationClient* activation_client_; |
+ std::deque<ash::LauncherID> app_placeholders_; |
sky
2012/08/15 20:52:36
Add a description of this. Or perhaps a general de
xiyuan
2012/08/15 21:36:03
Added general description above StartLoadingUI.
|
+ ProfileSyncService* observed_sync_service_; |
+ base::OneShotTimer<ChromeLauncherController> loading_timer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
}; |