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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 1306173002: Set font size to 14 in location bar for material design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: padding Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 location_icon_view_ = new LocationIconView(this); 197 location_icon_view_ = new LocationIconView(this);
198 location_icon_view_->set_drag_controller(this); 198 location_icon_view_->set_drag_controller(this);
199 AddChildView(location_icon_view_); 199 AddChildView(location_icon_view_);
200 200
201 // Determine the main font. 201 // Determine the main font.
202 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( 202 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList(
203 ResourceBundle::BaseFont); 203 ResourceBundle::BaseFont);
204 const int current_font_size = font_list.GetFontSize(); 204 const int current_font_size = font_list.GetFontSize();
205 const int desired_font_size = browser_defaults::kOmniboxFontPixelSize; 205 const int desired_font_size = GetLayoutConstant(OMNIBOX_FONT_PIXEL_SIZE);
206 if (current_font_size != desired_font_size) { 206 if (current_font_size != desired_font_size) {
207 font_list = 207 font_list =
208 font_list.DeriveWithSizeDelta(desired_font_size - current_font_size); 208 font_list.DeriveWithSizeDelta(desired_font_size - current_font_size);
209 } 209 }
210 // Shrink large fonts to make them fit. 210 // Shrink large fonts to make them fit.
211 // TODO(pkasting): Stretch the location bar instead in this case. 211 // TODO(pkasting): Stretch the location bar instead in this case.
212 const int location_height = GetInternalHeight(true); 212 const int location_height = GetInternalHeight(true);
213 font_list = font_list.DeriveWithHeightUpperBound(location_height); 213 font_list = font_list.DeriveWithHeightUpperBound(location_height);
214 214
215 // Determine the font for use inside the bubbles. The bubble background 215 // Determine the font for use inside the bubbles. The bubble background
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 1381
1382 void LocationBarView::ModelChanged(const SearchModel::State& old_state, 1382 void LocationBarView::ModelChanged(const SearchModel::State& old_state,
1383 const SearchModel::State& new_state) { 1383 const SearchModel::State& new_state) {
1384 const bool visible = !GetToolbarModel()->input_in_progress() && 1384 const bool visible = !GetToolbarModel()->input_in_progress() &&
1385 new_state.voice_search_supported; 1385 new_state.voice_search_supported;
1386 if (mic_search_view_->visible() != visible) { 1386 if (mic_search_view_->visible() != visible) {
1387 mic_search_view_->SetVisible(visible); 1387 mic_search_view_->SetVisible(visible);
1388 Layout(); 1388 Layout();
1389 } 1389 }
1390 } 1390 }
OLDNEW
« chrome/browser/ui/views/layout_constants.cc ('K') | « chrome/browser/ui/views/layout_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698