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

Side by Side Diff: views/controls/button/text_button.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/button/text_button.h" 5 #include "views/controls/button/text_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/throb_animation.h" 9 #include "app/throb_animation.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 void TextButton::UpdateColor() { 384 void TextButton::UpdateColor() {
385 color_ = IsEnabled() ? color_enabled_ : color_disabled_; 385 color_ = IsEnabled() ? color_enabled_ : color_disabled_;
386 } 386 }
387 387
388 void TextButton::UpdateTextSize() { 388 void TextButton::UpdateTextSize() {
389 int width = 0, height = 0; 389 int width = 0, height = 0;
390 gfx::CanvasSkia::SizeStringInt( 390 gfx::CanvasSkia::SizeStringInt(
391 text_, font_, &width, &height, 391 text_, font_, &width, &height,
392 gfx::Canvas::NO_ELLIPSIS | PrefixTypeToCanvasType(prefix_type_)); 392 gfx::Canvas::NO_ELLIPSIS | PrefixTypeToCanvasType(prefix_type_));
393 text_size_.SetSize(width, font_.height()); 393 text_size_.SetSize(width, font_.GetHeight());
394 max_text_size_.SetSize(std::max(max_text_size_.width(), text_size_.width()), 394 max_text_size_.SetSize(std::max(max_text_size_.width(), text_size_.width()),
395 std::max(max_text_size_.height(), 395 std::max(max_text_size_.height(),
396 text_size_.height())); 396 text_size_.height()));
397 PreferredSizeChanged(); 397 PreferredSizeChanged();
398 } 398 }
399 399
400 //////////////////////////////////////////////////////////////////////////////// 400 ////////////////////////////////////////////////////////////////////////////////
401 // TextButton, View overrides: 401 // TextButton, View overrides:
402 402
403 gfx::Size TextButton::GetPreferredSize() { 403 gfx::Size TextButton::GetPreferredSize() {
(...skipping 29 matching lines...) Expand all
433 433
434 std::string TextButton::GetClassName() const { 434 std::string TextButton::GetClassName() const {
435 return kViewClassName; 435 return kViewClassName;
436 } 436 }
437 437
438 void TextButton::Paint(gfx::Canvas* canvas) { 438 void TextButton::Paint(gfx::Canvas* canvas) {
439 Paint(canvas, false); 439 Paint(canvas, false);
440 } 440 }
441 441
442 } // namespace views 442 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/native_button_win.cc ('k') | views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698