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

Side by Side Diff: ash/launcher/launcher_button.cc

Issue 11348366: New resources for launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resource Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher_button.h" 5 #include "ash/launcher/launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher_button_host.h" 9 #include "ash/launcher/launcher_button_host.h"
10 #include "grit/ash_resources.h" 10 #include "grit/ash_resources.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return host_->GetShelfAlignment() == SHELF_ALIGNMENT_BOTTOM; 347 return host_->GetShelfAlignment() == SHELF_ALIGNMENT_BOTTOM;
348 } 348 }
349 349
350 void LauncherButton::UpdateState() { 350 void LauncherButton::UpdateState() {
351 if (state_ == STATE_NORMAL) { 351 if (state_ == STATE_NORMAL) {
352 bar_->SetVisible(false); 352 bar_->SetVisible(false);
353 } else { 353 } else {
354 int bar_id; 354 int bar_id;
355 if (IsShelfHorizontal()) { 355 if (IsShelfHorizontal()) {
356 if (state_ & STATE_ACTIVE) 356 if (state_ & STATE_ACTIVE)
357 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_ACTIVE; 357 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_BOTTOM_ACTIVE;
358 else if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION)) 358 else if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION))
359 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_HOVER; 359 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_BOTTOM_HOVER;
360 else 360 else
361 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_RUNNING; 361 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_BOTTOM_RUNNING;
362 } else { 362 } else {
363 if (state_ & STATE_ACTIVE) 363 if (state_ & STATE_ACTIVE)
364 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_ACTIVE; 364 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_LEFT_ACTIVE;
365 else if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION)) 365 else if (state_ & (STATE_HOVERED | STATE_FOCUSED | STATE_ATTENTION))
366 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_HOVER; 366 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_LEFT_HOVER;
367 else 367 else
368 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_VERTICAL_RUNNING; 368 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_LEFT_RUNNING;
369 } 369 }
370 370
371 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 371 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
372 bar_->SetImage(rb.GetImageNamed(bar_id).ToImageSkia()); 372 bar_->SetImage(rb.GetImageNamed(bar_id).ToImageSkia());
373 bar_->SetVisible(true); 373 bar_->SetVisible(true);
374 } 374 }
375 375
376 switch (host_->GetShelfAlignment()) { 376 switch (host_->GetShelfAlignment()) {
377 case SHELF_ALIGNMENT_BOTTOM: 377 case SHELF_ALIGNMENT_BOTTOM:
378 bar_->SetHorizontalAlignment(views::ImageView::CENTER); 378 bar_->SetHorizontalAlignment(views::ImageView::CENTER);
(...skipping 12 matching lines...) Expand all
391 bar_->SetVerticalAlignment(views::ImageView::CENTER); 391 bar_->SetVerticalAlignment(views::ImageView::CENTER);
392 break; 392 break;
393 } 393 }
394 394
395 Layout(); 395 Layout();
396 SchedulePaint(); 396 SchedulePaint();
397 } 397 }
398 398
399 } // namespace internal 399 } // namespace internal
400 } // namespace ash 400 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698