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

Unified Diff: ash/launcher/launcher_button.cc

Issue 10823351: Update launcher status images (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: permissions 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
« no previous file with comments | « no previous file | ui/resources/default_100_percent/ash/launcher_browser.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_button.cc
diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc
index ce6dcbea70bf5134fc707d74702976e7acc285e1..cc154c07c53a5aea42cedcc5edceb4a18b000394 100644
--- a/ash/launcher/launcher_button.cc
+++ b/ash/launcher/launcher_button.cc
@@ -34,11 +34,9 @@ const int kBarSize = 3;
const int kBarSpacing = 5;
const int kIconSize = 32;
const int kHopSpacing = 2;
-const int kActiveBarColor = 0xe6ffffff;
-const int kInactiveBarColor = 0x80ffffff;
-const int kHopUpMS = 200;
+const int kHopUpMS = 0;
const int kHopDownMS = 200;
-const int kAttentionThrobDurationMS = 2000;
+const int kAttentionThrobDurationMS = 1000;
bool ShouldHop(int state) {
return state & ash::internal::LauncherButton::STATE_HOVERED ||
@@ -466,22 +464,26 @@ void LauncherButton::UpdateState() {
if (state_ == STATE_NORMAL || state_ & STATE_PENDING) {
bar_->SetVisible(false);
} else {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
int bar_id;
- bar_->SetVisible(true);
-
- if (state_ & STATE_ACTIVE || state_ & STATE_ATTENTION) {
- bar_id = IsShelfHorizontal() ? IDR_AURA_LAUNCHER_UNDERLINE_ACTIVE :
- IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_ACTIVE;
- } else if (state_ & STATE_HOVERED || state_ & STATE_FOCUSED) {
- bar_id = IsShelfHorizontal() ? IDR_AURA_LAUNCHER_UNDERLINE_HOVER :
- IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_HOVER;
+ if (IsShelfHorizontal()) {
+ if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION))
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_HOVER;
+ else if (state_ & STATE_ACTIVE)
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_ACTIVE;
+ else
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_RUNNING;
} else {
- bar_id = IsShelfHorizontal() ? IDR_AURA_LAUNCHER_UNDERLINE_RUNNING :
- IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_RUNNING;
+ if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION))
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_HOVER;
+ else if (state_ & STATE_ACTIVE)
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_ACTIVE;
+ else
+ bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_RUNNING;
}
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
bar_->SetImage(rb.GetImageNamed(bar_id).ToImageSkia());
+ bar_->SetVisible(true);
}
switch (host_->GetShelfAlignment()) {
« no previous file with comments | « no previous file | ui/resources/default_100_percent/ash/launcher_browser.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698