Commit 79585cfd authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Update omnibox fonts when MD mode changes

BUG=737995,881371
R=pkasting

Change-Id: I0723a4cf2e31c2ffd8a07869ce4742091e1ea8c1
Reviewed-on: https://chromium-review.googlesource.com/c/1258522
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596390}
parent 321723b0
...@@ -48,7 +48,7 @@ void ApplyCommonFontStyles(int context, ...@@ -48,7 +48,7 @@ void ApplyCommonFontStyles(int context,
// TODO(pbos): Instead of fixing the toolbar button height this way // TODO(pbos): Instead of fixing the toolbar button height this way
// consider dynamically resizing all of the toolbar based on the actual // consider dynamically resizing all of the toolbar based on the actual
// final item height. // final item height.
static const int fixed_height = const int fixed_height =
ui::MaterialDesignController::IsTouchOptimizedUiEnabled() ? 22 : 17; ui::MaterialDesignController::IsTouchOptimizedUiEnabled() ? 22 : 17;
static const int toolbar_button_delta = static const int toolbar_button_delta =
GetFontSizeDeltaBoundedByAvailableHeight(fixed_height, fixed_height); GetFontSizeDeltaBoundedByAvailableHeight(fixed_height, fixed_height);
...@@ -59,7 +59,7 @@ void ApplyCommonFontStyles(int context, ...@@ -59,7 +59,7 @@ void ApplyCommonFontStyles(int context,
case CONTEXT_OMNIBOX_DEEMPHASIZED: { case CONTEXT_OMNIBOX_DEEMPHASIZED: {
constexpr int kDesiredFontSizeRegular = 14; constexpr int kDesiredFontSizeRegular = 14;
constexpr int kDesiredFontSizeTouchable = 15; constexpr int kDesiredFontSizeTouchable = 15;
static const int omnibox_primary_delta = const int omnibox_primary_delta =
GetFontSizeDeltaBoundedByAvailableHeight( GetFontSizeDeltaBoundedByAvailableHeight(
LocationBarView::GetAvailableTextHeight(), LocationBarView::GetAvailableTextHeight(),
ui::MaterialDesignController::IsTouchOptimizedUiEnabled() ui::MaterialDesignController::IsTouchOptimizedUiEnabled()
......
...@@ -178,6 +178,10 @@ void IconLabelBubbleView::SetImage(const gfx::ImageSkia& image_skia) { ...@@ -178,6 +178,10 @@ void IconLabelBubbleView::SetImage(const gfx::ImageSkia& image_skia) {
image_->SetImage(image_skia); image_->SetImage(image_skia);
} }
void IconLabelBubbleView::SetFontList(const gfx::FontList& font_list) {
label_->SetFontList(font_list);
}
bool IconLabelBubbleView::ShouldShowSeparator() const { bool IconLabelBubbleView::ShouldShowSeparator() const {
return ShouldShowLabel(); return ShouldShowLabel();
} }
......
...@@ -76,6 +76,7 @@ class IconLabelBubbleView : public views::InkDropObserver, ...@@ -76,6 +76,7 @@ class IconLabelBubbleView : public views::InkDropObserver,
void SetLabel(const base::string16& label); void SetLabel(const base::string16& label);
void SetImage(const gfx::ImageSkia& image); void SetImage(const gfx::ImageSkia& image);
void SetFontList(const gfx::FontList& font_list);
const views::ImageView* GetImageView() const { return image_; } const views::ImageView* GetImageView() const { return image_; }
views::ImageView* GetImageView() { return image_; } views::ImageView* GetImageView() { return image_; }
......
...@@ -1332,6 +1332,16 @@ void LocationBarView::SetFocusAndSelection(bool select_all) { ...@@ -1332,6 +1332,16 @@ void LocationBarView::SetFocusAndSelection(bool select_all) {
// LocationBarView, private ui::MaterialDesignControllerObserver implementation: // LocationBarView, private ui::MaterialDesignControllerObserver implementation:
void LocationBarView::OnMdModeChanged() { void LocationBarView::OnMdModeChanged() {
const gfx::FontList& font_list = views::style::GetFont(
CONTEXT_OMNIBOX_PRIMARY, views::style::STYLE_PRIMARY);
location_icon_view_->SetFontList(font_list);
omnibox_view_->SetFontList(font_list);
ime_inline_autocomplete_view_->SetFontList(font_list);
selected_keyword_view_->SetFontList(font_list);
for (ContentSettingImageView* view : content_setting_views_)
view->SetFontList(font_list);
if (save_credit_card_icon_view_)
save_credit_card_icon_view_->SetFontList(font_list);
RefreshLocationIcon(); RefreshLocationIcon();
Layout(); Layout();
SchedulePaint(); SchedulePaint();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment