Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 02c1de32f88b077a8ad2ffd5585e8fdcceed6496..0f64ed93514d4bf32e4fb95c2da37761261d46a1 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -218,14 +218,24 @@ void LocationBarView::Init() { |
| const int bubble_vertical_padding = |
| (GetLayoutConstant(LOCATION_BAR_BUBBLE_VERTICAL_PADDING) + |
| kBubbleInteriorVerticalPadding) * 2; |
| - const gfx::FontList bubble_font_list(font_list.DeriveWithHeightUpperBound( |
| - location_height - bubble_vertical_padding)); |
| + const int desired_bubble_font_size = |
| + GetLayoutConstant(LOCATION_BAR_BUBBLE_FONT_PIXEL_SIZE); |
| + gfx::FontList bubble_font_list = font_list; |
| + if (bubble_font_list.GetFontSize() != desired_bubble_font_size) { |
| + bubble_font_list = bubble_font_list.DeriveWithSizeDelta( |
| + desired_bubble_font_size - bubble_font_list.GetFontSize()); |
| + } |
| + bubble_font_list = bubble_font_list.DeriveWithHeightUpperBound( |
| + location_height - bubble_vertical_padding); |
| const SkColor background_color = |
| GetColor(SecurityStateModel::NONE, LocationBarView::BACKGROUND); |
| - ev_bubble_view_ = new EVBubbleView( |
| - bubble_font_list, GetColor(SecurityStateModel::EV_SECURE, SECURITY_TEXT), |
| - background_color, this); |
| + const SkColor ev_text_color = |
| + GetColor(SecurityStateModel::EV_SECURE, |
| + ui::MaterialDesignController::IsModeMaterial() ? BUBBLE_TEXT |
| + : SECURITY_TEXT); |
| + ev_bubble_view_ = |
| + new EVBubbleView(bubble_font_list, ev_text_color, background_color, this); |
| ev_bubble_view_->set_drag_controller(this); |
| AddChildView(ev_bubble_view_); |
| @@ -250,7 +260,9 @@ void LocationBarView::Init() { |
| ime_inline_autocomplete_view_->SetVisible(false); |
| AddChildView(ime_inline_autocomplete_view_); |
| - const SkColor text_color = GetColor(SecurityStateModel::NONE, TEXT); |
| + const SkColor text_color = GetColor( |
| + SecurityStateModel::NONE, |
| + ui::MaterialDesignController::IsModeMaterial() ? BUBBLE_TEXT : TEXT); |
| selected_keyword_view_ = new SelectedKeywordView( |
| bubble_font_list, text_color, background_color, profile()); |
| AddChildView(selected_keyword_view_); |
| @@ -371,6 +383,9 @@ SkColor LocationBarView::GetColor( |
| color, GetColor(security_level, BACKGROUND)); |
| } |
| + case BUBBLE_TEXT: |
| + return SK_ColorWHITE; |
| + |
| default: |
| NOTREACHED(); |
| return GetColor(security_level, TEXT); |
| @@ -853,6 +868,9 @@ int LocationBarView::IncrementalMinimumWidth(views::View* view) const { |
| } |
| int LocationBarView::GetHorizontalEdgeThickness() const { |
| + // In Material Design horizontal layout disregards the border. |
| + if (ui::MaterialDesignController::IsModeMaterial()) |
| + return 0; |
|
Peter Kasting
2015/10/01 01:12:17
Conceptually it seems like if this is correct, we'
|
| // In maximized popup mode, there isn't any edge. |
| return (is_popup_mode_ && browser_ && browser_->window() && |
| browser_->window()->IsMaximized()) ? |