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

Unified Diff: chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.cc

Issue 11371003: app_list: Add sync animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix missed init Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.cc
diff --git a/chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.cc b/chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c791c006028ebd06470872de1959646affa3d17b
--- /dev/null
+++ b/chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h"
+
+#include "chrome/browser/ui/ash/app_sync_ui_state.h"
+#include "ui/app_list/app_list_model.h"
+
+AppSyncUIStateWatcher::AppSyncUIStateWatcher(Profile* profile,
+ app_list::AppListModel* model)
+ : app_sync_ui_state_(AppSyncUIState::Get(profile)),
+ model_(model) {
+ if (app_sync_ui_state_) {
+ app_sync_ui_state_->AddObserver(this);
+ OnAppSyncUIStatusChanged();
+ }
+}
+
+AppSyncUIStateWatcher::~AppSyncUIStateWatcher() {
+ if (app_sync_ui_state_)
+ app_sync_ui_state_->RemoveObserver(this);
+}
+
+void AppSyncUIStateWatcher::OnAppSyncUIStatusChanged() {
+ if (app_sync_ui_state_->status() == AppSyncUIState::STATUS_SYNCING)
+ model_->SetStatus(app_list::AppListModel::STATUS_SYNCING);
+ else
+ model_->SetStatus(app_list::AppListModel::STATUS_NORMAL);
+}
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698