Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3394)

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.h

Issue 10829268: chromeos: Sync animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_tests crash + rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 411a5ead8c60a6d1617a629ea5f37fa87578f09b..3a0a841dfa76933b382fa5399bd4dd106744de0e 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -17,9 +17,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 +44,7 @@ class BrowserLauncherItemController;
class BrowserLauncherItemControllerTest;
class PrefService;
class Profile;
+class ProfileSyncService;
class TabContents;
// ChromeLauncherController manages the launcher items needed for tabbed
@@ -53,7 +56,8 @@ class ChromeLauncherController
public content::NotificationObserver,
public extensions::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 {
@@ -226,6 +230,7 @@ class ChromeLauncherController
virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE;
virtual void LauncherItemChanged(int index,
const ash::LauncherItem& old_item) OVERRIDE;
+ virtual void LauncherStatusChanged() OVERRIDE;
// Overridden from content::NotificationObserver:
virtual void Observe(int type,
@@ -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
+ // and calls StopLoadingAnimation when both conditions are met.
+ void CheckAppSync();
+
+ void StartLoadingAnimation();
+ void StopLoadingAnimation();
+
static ChromeLauncherController* instance_;
ash::LauncherModel* model_;
@@ -354,6 +365,9 @@ class ChromeLauncherController
PrefChangeRegistrar pref_change_registrar_;
aura::client::ActivationClient* activation_client_;
+ ProfileSyncService* observed_sync_service_;
+ base::OneShotTimer<ChromeLauncherController> loading_timer_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController);
};
« no previous file with comments | « chrome/browser/extensions/pending_extension_manager.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698