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

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

Issue 15174004: Merge 198585 "Regression issue with "ShouldHop", the UpdateState..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/launcher/launcher_view_unittest.cc » ('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 "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 void LauncherButton::AddState(State state) { 294 void LauncherButton::AddState(State state) {
295 if (!(state_ & state)) { 295 if (!(state_ & state)) {
296 if (ShouldHop(state) || !ShouldHop(state_)) { 296 if (ShouldHop(state) || !ShouldHop(state_)) {
297 ui::ScopedLayerAnimationSettings scoped_setter( 297 ui::ScopedLayerAnimationSettings scoped_setter(
298 icon_view_->layer()->GetAnimator()); 298 icon_view_->layer()->GetAnimator());
299 scoped_setter.SetTransitionDuration( 299 scoped_setter.SetTransitionDuration(
300 base::TimeDelta::FromMilliseconds(kHopUpMS)); 300 base::TimeDelta::FromMilliseconds(kHopUpMS));
301 } 301 }
302 state_ |= state; 302 state_ |= state;
303 UpdateState(); 303 Layout();
304 if (state & STATE_ATTENTION) 304 if (state & STATE_ATTENTION)
305 bar_->ShowAttention(true); 305 bar_->ShowAttention(true);
306 } 306 }
307 } 307 }
308 308
309 void LauncherButton::ClearState(State state) { 309 void LauncherButton::ClearState(State state) {
310 if (state_ & state) { 310 if (state_ & state) {
311 if (!ShouldHop(state) || ShouldHop(state_)) { 311 if (!ShouldHop(state) || ShouldHop(state_)) {
312 ui::ScopedLayerAnimationSettings scoped_setter( 312 ui::ScopedLayerAnimationSettings scoped_setter(
313 icon_view_->layer()->GetAnimator()); 313 icon_view_->layer()->GetAnimator());
314 scoped_setter.SetTweenType(ui::Tween::LINEAR); 314 scoped_setter.SetTweenType(ui::Tween::LINEAR);
315 scoped_setter.SetTransitionDuration( 315 scoped_setter.SetTransitionDuration(
316 base::TimeDelta::FromMilliseconds(kHopDownMS)); 316 base::TimeDelta::FromMilliseconds(kHopDownMS));
317 } 317 }
318 state_ &= ~state; 318 state_ &= ~state;
319 UpdateState(); 319 Layout();
320 if (state & STATE_ATTENTION) 320 if (state & STATE_ATTENTION)
321 bar_->ShowAttention(false); 321 bar_->ShowAttention(false);
322 } 322 }
323 } 323 }
324 324
325 gfx::Rect LauncherButton::GetIconBounds() const { 325 gfx::Rect LauncherButton::GetIconBounds() const {
326 return icon_view_->bounds(); 326 return icon_view_->bounds();
327 } 327 }
328 328
329 void LauncherButton::ShowContextMenu(const gfx::Point& p, 329 void LauncherButton::ShowContextMenu(const gfx::Point& p,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 views::ImageView::TRAILING, 520 views::ImageView::TRAILING,
521 views::ImageView::CENTER, 521 views::ImageView::CENTER,
522 views::ImageView::CENTER, 522 views::ImageView::CENTER,
523 views::ImageView::LEADING)); 523 views::ImageView::LEADING));
524 bar_->SchedulePaint(); 524 bar_->SchedulePaint();
525 SchedulePaint(); 525 SchedulePaint();
526 } 526 }
527 527
528 } // namespace internal 528 } // namespace internal
529 } // namespace ash 529 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/launcher/launcher_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698