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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (nits in ui/views/ Created 5 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
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/menu_button.h » ('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 "ui/views/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/gfx/animation/throb_animation.h" 9 #include "ui/gfx/animation/throb_animation.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 gfx::Point label_origin(label_area.origin()); 330 gfx::Point label_origin(label_area.origin());
331 if (!image_size.IsEmpty() && adjusted_alignment != gfx::ALIGN_RIGHT) { 331 if (!image_size.IsEmpty() && adjusted_alignment != gfx::ALIGN_RIGHT) {
332 label_origin.set_x(image_origin.x() + image_size.width() + 332 label_origin.set_x(image_origin.x() + image_size.width() +
333 image_label_spacing_); 333 image_label_spacing_);
334 } 334 }
335 335
336 image_->SetBoundsRect(gfx::Rect(image_origin, image_size)); 336 image_->SetBoundsRect(gfx::Rect(image_origin, image_size));
337 label_->SetBoundsRect(gfx::Rect(label_origin, label_size)); 337 label_->SetBoundsRect(gfx::Rect(label_origin, label_size));
338 CustomButton::Layout();
338 } 339 }
339 340
340 const char* LabelButton::GetClassName() const { 341 const char* LabelButton::GetClassName() const {
341 return kViewClassName; 342 return kViewClassName;
342 } 343 }
343 344
344 void LabelButton::EnableCanvasFlippingForRTLUI(bool flip) { 345 void LabelButton::EnableCanvasFlippingForRTLUI(bool flip) {
345 CustomButton::EnableCanvasFlippingForRTLUI(flip); 346 CustomButton::EnableCanvasFlippingForRTLUI(flip);
346 image_->EnableCanvasFlippingForRTLUI(flip); 347 image_->EnableCanvasFlippingForRTLUI(flip);
347 } 348 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 GetExtraParams(params); 510 GetExtraParams(params);
510 return ui::NativeTheme::kHovered; 511 return ui::NativeTheme::kHovered;
511 } 512 }
512 513
513 void LabelButton::ResetCachedPreferredSize() { 514 void LabelButton::ResetCachedPreferredSize() {
514 cached_preferred_size_valid_ = false; 515 cached_preferred_size_valid_ = false;
515 cached_preferred_size_ = gfx::Size(); 516 cached_preferred_size_ = gfx::Size();
516 } 517 }
517 518
518 } // namespace views 519 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698