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

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

Issue 10860053: Reland 152221 - chromeos: Sync animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 79d710ec1dc9ab348ccfb420b95853cfcec58f0f..6f8dddc070fd07008a0ca58dbcb9b73276338de7 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/api/prefs/pref_change_registrar.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/shell_window_registry.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 BrowserLauncherItemControllerTest;
class LauncherItemController;
class PrefService;
class Profile;
+class ProfileSyncService;
class TabContents;
// ChromeLauncherController manages the launcher items needed for content
@@ -54,7 +57,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 {
@@ -227,6 +231,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,
@@ -237,17 +242,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,15 @@ class ChromeLauncherController
ash::LauncherItemStatus status,
int index);
+ // Checks whether app sync status and starts/stops loading animation
+ // accordingly. If sync has not setup, do nothing. If sync is completed and
+ // there is no pending synced extension install, call StopLoadingAnimation.
+ // Otherwise, call StartLoadingAnimation.
+ void CheckAppSync();
+
+ void StartLoadingAnimation();
+ void StopLoadingAnimation();
+
static ChromeLauncherController* instance_;
ash::LauncherModel* model_;
@@ -354,6 +367,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