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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 1998493002: Update omnibox chips in MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review 2 Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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 6b4235d1f1b8bcacf45da01c17582ccdf9de49a4..f77109a4205bcd4ea9149c76629fee97ec728802 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -218,10 +218,13 @@ void LocationBarView::Init() {
const int bubble_height = location_height - (bubble_padding * 2);
gfx::FontList bubble_font_list =
font_list.DeriveWithHeightUpperBound(bubble_height);
+ gfx::FontList chip_font_list = ui::MaterialDesignController::IsModeMaterial()
+ ? font_list
+ : bubble_font_list;
const SkColor background_color = GetColor(BACKGROUND);
location_icon_view_ =
- new LocationIconView(bubble_font_list, background_color, this);
+ new LocationIconView(chip_font_list, background_color, this);
location_icon_view_->set_drag_controller(this);
AddChildView(location_icon_view_);
@@ -248,7 +251,7 @@ void LocationBarView::Init() {
const SkColor selected_text_color = GetColor(TEXT);
selected_keyword_view_ = new SelectedKeywordView(
- bubble_font_list, selected_text_color, background_color, profile());
+ chip_font_list, selected_text_color, background_color, profile());
AddChildView(selected_keyword_view_);
suggested_text_view_ = new views::Label(base::string16(), font_list);
@@ -269,7 +272,7 @@ void LocationBarView::Init() {
for (ContentSettingImageModel* model : models.get()) {
// ContentSettingImageView takes ownership of its model.
ContentSettingImageView* image_view = new ContentSettingImageView(
- model, this, bubble_font_list, background_color);
+ model, this, chip_font_list, background_color);
content_setting_views_.push_back(image_view);
image_view->SetVisible(false);
AddChildView(image_view);
@@ -577,8 +580,10 @@ void LocationBarView::Layout() {
LocationBarLayout leading_decorations(
LocationBarLayout::LEFT_EDGE, item_padding,
- item_padding - omnibox_view_->GetInsets().left() -
- GetEditLeadingInternalSpace());
+ ui::MaterialDesignController::IsModeMaterial()
+ ? 2
+ : item_padding - omnibox_view_->GetInsets().left() -
+ GetEditLeadingInternalSpace());
Peter Kasting 2016/05/20 20:54:11 Nit: I'd parenthesize this last subexpr just to av
Evan Stade 2016/05/20 22:33:53 Done.
LocationBarLayout trailing_decorations(
LocationBarLayout::RIGHT_EDGE, item_padding, trailing_edge_item_padding);

Powered by Google App Engine
This is Rietveld 408576698