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

Unified Diff: ash/launcher/launcher_model.h

Issue 10829268: chromeos: Sync animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wrap up + 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: ash/launcher/launcher_model.h
diff --git a/ash/launcher/launcher_model.h b/ash/launcher/launcher_model.h
index d4cd05eb367b522fb15c1bca1c0a95e3b2a65f36..374566e1eaaea0fffb45492036e3fd119b7249d0 100644
--- a/ash/launcher/launcher_model.h
+++ b/ash/launcher/launcher_model.h
@@ -22,6 +22,12 @@ class LauncherModelObserver;
// Model used by LauncherView.
class ASH_EXPORT LauncherModel {
public:
+ enum UIState {
+ NORMAL,
+ // In this state, Launcher shows a loading animation.
+ LOADING,
+ };
+
LauncherModel();
~LauncherModel();
@@ -59,16 +65,26 @@ class ASH_EXPORT LauncherModel {
void AddObserver(LauncherModelObserver* observer);
void RemoveObserver(LauncherModelObserver* observer);
+ void SetUIState(UIState ui_state);
+ UIState ui_state() const { return ui_state_; }
+
private:
// Makes sure |index| is in line with the type-based order of items. If that
// is not the case, adjusts index by shifting it to the valid range and
// returns the new value.
int ValidateInsertionIndex(LauncherItemType type, int index) const;
+ // Gets desired number of loading placeholders.
+ int GetDesiredNumOfPlaceholders();
+
+ // Ensures the model has exactly |n| loading placeholders.
+ void UpdatePlaceholders(int n);
+
// ID assigned to the next item.
LauncherID next_id_;
LauncherItems items_;
ObserverList<LauncherModelObserver> observers_;
+ UIState ui_state_;
DISALLOW_COPY_AND_ASSIGN(LauncherModel);
};

Powered by Google App Engine
This is Rietveld 408576698