diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 20:51:19 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 20:51:19 +0000 |
commit | a32bd2113f84e91c5d9d06aae77fae0c2e0dcc9b (patch) | |
tree | c8070d3d1315ddc5ca29de2be6015e811ed50fbf /chrome | |
parent | e27a5f5229ae9c5257569c1c8d0f632c115a5cd7 (diff) | |
download | chromium_src-a32bd2113f84e91c5d9d06aae77fae0c2e0dcc9b.zip chromium_src-a32bd2113f84e91c5d9d06aae77fae0c2e0dcc9b.tar.gz chromium_src-a32bd2113f84e91c5d9d06aae77fae0c2e0dcc9b.tar.bz2 |
Convert Label::GetFont() to unix_hacker style. Original patch by Thiago Farina (see http://codereview.chromium.org/1580002 ), r=me.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1528009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
9 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/chromeos/options/language_config_view.cc b/chrome/browser/chromeos/options/language_config_view.cc index ae9f280..7c23e73 100644 --- a/chrome/browser/chromeos/options/language_config_view.cc +++ b/chrome/browser/chromeos/options/language_config_view.cc @@ -236,7 +236,7 @@ views::View* LanguageConfigView::CreatePerLanguageConfigView( l10n_util::GetString( IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD)); const gfx::Font bold_font = - title_label->GetFont().DeriveFont(0, gfx::Font::BOLD); + title_label->font().DeriveFont(0, gfx::Font::BOLD); title_label->SetFont(bold_font); // Add the title label. diff --git a/chrome/browser/chromeos/text_input/candidate_window.cc b/chrome/browser/chromeos/text_input/candidate_window.cc index a7bab58..72c2140 100644 --- a/chrome/browser/chromeos/text_input/candidate_window.cc +++ b/chrome/browser/chromeos/text_input/candidate_window.cc @@ -372,7 +372,7 @@ void CandidateView::Init() { views::View* wrapped_shortcut_label = WrapWithPadding(shortcut_label_, insets); // Make the font bold. - gfx::Font font = shortcut_label_->GetFont(); + gfx::Font font = shortcut_label_->font(); gfx::Font bold_font = font.DeriveFont(0, gfx::Font::BOLD); shortcut_label_->SetFont(bold_font); // TODO(satorux): Maybe we need to use language specific fonts for diff --git a/chrome/browser/views/content_blocked_bubble_contents.cc b/chrome/browser/views/content_blocked_bubble_contents.cc index 45dde56..f423b04 100644 --- a/chrome/browser/views/content_blocked_bubble_contents.cc +++ b/chrome/browser/views/content_blocked_bubble_contents.cc @@ -248,7 +248,7 @@ void ContentSettingBubbleContents::InitControlLayout() { } gfx::Font domain_font = - views::Label().GetFont().DeriveFont(0, gfx::Font::BOLD); + views::Label().font().DeriveFont(0, gfx::Font::BOLD); const int indented_single_column_set_id = 3; // Insert a column set to indent the domain list. views::ColumnSet* indented_single_column_set = diff --git a/chrome/browser/views/extensions/extension_install_prompt.cc b/chrome/browser/views/extensions/extension_install_prompt.cc index 7e45c67..3a6329f 100644 --- a/chrome/browser/views/extensions/extension_install_prompt.cc +++ b/chrome/browser/views/extensions/extension_install_prompt.cc @@ -64,7 +64,7 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { heading_ = new views::Label( l10n_util::GetStringF(ExtensionInstallUI::kHeadingIds[type_], UTF8ToWide(extension->name()))); - heading_->SetFont(heading_->GetFont().DeriveFont(1, gfx::Font::BOLD)); + heading_->SetFont(heading_->font().DeriveFont(1, gfx::Font::BOLD)); heading_->SetMultiLine(true); heading_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(heading_); diff --git a/chrome/browser/views/extensions/extension_install_prompt2.cc b/chrome/browser/views/extensions/extension_install_prompt2.cc index 56cb82d..478b166 100644 --- a/chrome/browser/views/extensions/extension_install_prompt2.cc +++ b/chrome/browser/views/extensions/extension_install_prompt2.cc @@ -89,7 +89,7 @@ class InstallDialogContent2 // Displays the permission box header "The extension will have access to:". views::Label* will_have_access_to_; - + // The white box containing the list of permissions the extension requires. // This can be NULL if the extension requires no permissions. views::View* permission_box_; @@ -129,7 +129,7 @@ InstallDialogContent2::InstallDialogContent2( heading_ = new views::Label( l10n_util::GetStringF(IDS_EXTENSION_INSTALL_PROMPT_HEADING, UTF8ToWide(extension->name()))); - heading_->SetFont(heading_->GetFont().DeriveFont(1, gfx::Font::BOLD)); + heading_->SetFont(heading_->font().DeriveFont(1, gfx::Font::BOLD)); heading_->SetMultiLine(true); heading_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(heading_); diff --git a/chrome/browser/views/page_info_window_view.cc b/chrome/browser/views/page_info_window_view.cc index 539a281..80d0db1 100644 --- a/chrome/browser/views/page_info_window_view.cc +++ b/chrome/browser/views/page_info_window_view.cc @@ -399,7 +399,7 @@ Section::Section(const string16& title, head_line_label_ = new views::Label(UTF16ToWideHack(head_line)); head_line_label_->SetFont( - head_line_label_->GetFont().DeriveFont(0, gfx::Font::BOLD)); + head_line_label_->font().DeriveFont(0, gfx::Font::BOLD)); head_line_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(head_line_label_); diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc index 823b900..a76c6e2 100644 --- a/chrome/browser/views/status_bubble_views.cc +++ b/chrome/browser/views/status_bubble_views.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -420,7 +420,7 @@ void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) { // Draw highlight text and then the text body. In order to make sure the text // is aligned to the right on RTL UIs, we mirror the text bounds if the // locale is RTL. - int text_width = std::min(views::Label::GetFont().GetStringWidth(text_), + int text_width = std::min(views::Label::font().GetStringWidth(text_), width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding); int text_height = height - (kShadowThickness * 2); gfx::Rect body_bounds(kShadowThickness + kTextPositionX, @@ -438,7 +438,7 @@ void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) { (SkColorGetG(text_color) + SkColorGetR(toolbar_color)) / 2, (SkColorGetB(text_color) + SkColorGetR(toolbar_color)) / 2); canvas->DrawStringInt(text_, - views::Label::GetFont(), + views::Label::font(), text_color, body_bounds.x(), body_bounds.y(), @@ -553,7 +553,7 @@ void StatusBubbleViews::SetURL(const GURL& url, const std::wstring& languages) { popup_->GetBounds(&popup_bounds, true); int text_width = static_cast<int>(popup_bounds.width() - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1); - url_text_ = gfx::ElideUrl(url, view_->Label::GetFont(), text_width, + url_text_ = gfx::ElideUrl(url, view_->Label::font(), text_width, languages); // An URL is always treated as a left-to-right string. On right-to-left UIs diff --git a/chrome/browser/views/theme_install_bubble_view.cc b/chrome/browser/views/theme_install_bubble_view.cc index 6d31a3a..3b3caa0 100644 --- a/chrome/browser/views/theme_install_bubble_view.cc +++ b/chrome/browser/views/theme_install_bubble_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -85,7 +85,7 @@ ThemeInstallBubbleView::~ThemeInstallBubbleView() { } gfx::Size ThemeInstallBubbleView::GetPreferredSize() { - return gfx::Size(views::Label::GetFont().GetStringWidth(text_) + + return gfx::Size(views::Label::font().GetStringWidth(text_) + kTextHorizPadding, ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::LargeFont).height() + kTextVertPadding); @@ -126,12 +126,12 @@ void ThemeInstallBubbleView::Paint(gfx::Canvas* canvas) { path.addRoundRect(rect, rad, SkPath::kCW_Direction); canvas->drawPath(path, paint); - int text_width = views::Label::GetFont().GetStringWidth(text_); + int text_width = views::Label::font().GetStringWidth(text_); gfx::Rect body_bounds(kTextHorizPadding / 2, 0, text_width, height()); body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); SkColor text_color = SK_ColorWHITE; - canvas->DrawStringInt(text_, views::Label::GetFont(), text_color, + canvas->DrawStringInt(text_, views::Label::font(), text_color, body_bounds.x(), body_bounds.y(), body_bounds.width(), body_bounds.height()); } diff --git a/chrome/browser/views/url_picker.cc b/chrome/browser/views/url_picker.cc index 60ee014..5f82832 100644 --- a/chrome/browser/views/url_picker.cc +++ b/chrome/browser/views/url_picker.cc @@ -103,7 +103,7 @@ UrlPicker::UrlPicker(UrlPickerDelegate* delegate, description_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); description_label->SetText(l10n_util::GetString(IDS_ASI_DESCRIPTION)); description_label->SetFont( - description_label->GetFont().DeriveFont(0, gfx::Font::BOLD)); + description_label->font().DeriveFont(0, gfx::Font::BOLD)); layout->AddView(description_label); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |