diff options
-rw-r--r-- | chrome/browser/chromeos/options/language_config_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/text_input/candidate_window.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/content_blocked_bubble_contents.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/extensions/extension_install_prompt.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/extensions/extension_install_prompt2.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/page_info_window_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/status_bubble_views.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/theme_install_bubble_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/url_picker.cc | 2 | ||||
-rw-r--r-- | views/controls/button/checkbox.cc | 2 | ||||
-rw-r--r-- | views/controls/label.h | 3 | ||||
-rw-r--r-- | views/controls/label_unittest.cc | 4 | ||||
-rw-r--r-- | views/controls/link.cc | 14 |
13 files changed, 28 insertions, 27 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); diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index 65981a4..3b0b804 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -89,7 +89,7 @@ void Checkbox::Layout() { label_x, 0, std::max(0, width() - label_x - kLabelFocusPaddingHorizontal), height()); - int first_line_height = label_->GetFont().height(); + int first_line_height = label_->font().height(); native_wrapper_->GetView()->SetBounds( 0, ((first_line_height - checkmark_prefsize.height()) / 2), checkmark_prefsize.width(), checkmark_prefsize.height()); diff --git a/views/controls/label.h b/views/controls/label.h index e97d6ec..b2d890e 100644 --- a/views/controls/label.h +++ b/views/controls/label.h @@ -82,8 +82,7 @@ class Label : public View { void SetText(const std::wstring& text); // Return the font used by this label. - // TODO(pkasting): Convert to unix_hacker() style. - gfx::Font GetFont() const { return font_; } + gfx::Font font() const { return font_; } // Return the label text. const std::wstring GetText() const; diff --git a/views/controls/label_unittest.cc b/views/controls/label_unittest.cc index ab4b1e9..5ea20b3 100644 --- a/views/controls/label_unittest.cc +++ b/views/controls/label_unittest.cc @@ -22,7 +22,7 @@ TEST(LabelTest, FontPropertyCourier) { std::wstring font_name(L"courier"); gfx::Font font = gfx::Font::CreateFont(font_name, 30); label.SetFont(font); - gfx::Font font_used = label.GetFont(); + gfx::Font font_used = label.font(); EXPECT_EQ(font_name, font_used.FontName()); EXPECT_EQ(30, font_used.FontSize()); } @@ -33,7 +33,7 @@ TEST(LabelTest, FontPropertyArial) { std::wstring font_name(L"arial"); gfx::Font font = gfx::Font::CreateFont(font_name, 30); label.SetFont(font); - gfx::Font font_used = label.GetFont(); + gfx::Font font_used = label.font(); EXPECT_EQ(font_name, font_used.FontName()); EXPECT_EQ(30, font_used.FontSize()); } diff --git a/views/controls/link.cc b/views/controls/link.cc index bf90fea..083870c 100644 --- a/views/controls/link.cc +++ b/views/controls/link.cc @@ -217,15 +217,17 @@ void Link::SetHighlighted(bool f) { } void Link::ValidateStyle() { - gfx::Font font = GetFont(); - if (enabled_) { - if ((font.style() & gfx::Font::UNDERLINED) == 0) - Label::SetFont(font.DeriveFont(0, font.style() | gfx::Font::UNDERLINED)); + if (!(font().style() & gfx::Font::UNDERLINED)) { + Label::SetFont( + font().DeriveFont(0, font().style() | gfx::Font::UNDERLINED)); + } Label::SetColor(highlighted_ ? highlighted_color_ : normal_color_); } else { - if ((font.style() & gfx::Font::UNDERLINED) != 0) - Label::SetFont(font.DeriveFont(0, font.style() & ~gfx::Font::UNDERLINED)); + if (font().style() & gfx::Font::UNDERLINED) { + Label::SetFont( + font().DeriveFont(0, font().style() & ~gfx::Font::UNDERLINED)); + } Label::SetColor(disabled_color_); } } |