OLD | NEW |
---|---|
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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 | 257 |
258 location_icon_view_ = new LocationIconView(this); | 258 location_icon_view_ = new LocationIconView(this); |
259 location_icon_view_->set_drag_controller(this); | 259 location_icon_view_->set_drag_controller(this); |
260 AddChildView(location_icon_view_); | 260 AddChildView(location_icon_view_); |
261 | 261 |
262 // Determine the main font. | 262 // Determine the main font. |
263 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( | 263 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( |
264 ResourceBundle::BaseFont); | 264 ResourceBundle::BaseFont); |
265 const int current_font_size = font_list.GetFontSize(); | 265 const int current_font_size = font_list.GetFontSize(); |
266 const int desired_font_size = browser_defaults::kOmniboxFontPixelSize; | 266 const int desired_font_size = browser_defaults::kOmniboxFontPixelSize; |
267 if (current_font_size < desired_font_size) | 267 if (current_font_size < desired_font_size) { |
msw
2014/01/21 19:31:12
nit: this should be !=, to also decrease the font
Yuki
2014/01/23 15:24:19
Done.
| |
268 font_list = font_list.DeriveFontListWithSize(desired_font_size); | 268 font_list = |
Alexei Svitkine (slow)
2014/01/20 15:38:10
Hmm, the left side looks cleaner. Is there a good
Yuki
2014/01/20 16:43:24
IMHO, all the fonts should ideally have relative s
| |
269 font_list.DeriveWithSizeDelta(desired_font_size - current_font_size); | |
270 } | |
269 // Shrink large fonts to make them fit. | 271 // Shrink large fonts to make them fit. |
270 // TODO(pkasting): Stretch the location bar instead in this case. | 272 // TODO(pkasting): Stretch the location bar instead in this case. |
271 const int location_height = GetInternalHeight(true); | 273 const int location_height = GetInternalHeight(true); |
272 font_list = GetLargestFontListWithHeightBound(font_list, location_height); | 274 font_list = GetLargestFontListWithHeightBound(font_list, location_height); |
273 | 275 |
274 // Determine the font for use inside the bubbles. The bubble background | 276 // Determine the font for use inside the bubbles. The bubble background |
275 // images have 1 px thick edges, which we don't want to overlap. | 277 // images have 1 px thick edges, which we don't want to overlap. |
276 const int kBubbleInteriorVerticalPadding = 1; | 278 const int kBubbleInteriorVerticalPadding = 1; |
277 const int bubble_vertical_padding = | 279 const int bubble_vertical_padding = |
278 (kBubblePadding + kBubbleInteriorVerticalPadding) * 2; | 280 (kBubblePadding + kBubbleInteriorVerticalPadding) * 2; |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1589 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1591 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
1590 location_bar_util::PaintExtensionActionBackground( | 1592 location_bar_util::PaintExtensionActionBackground( |
1591 *(*page_action_view)->image_view()->page_action(), | 1593 *(*page_action_view)->image_view()->page_action(), |
1592 tab_id, canvas, bounds, text_color, background_color); | 1594 tab_id, canvas, bounds, text_color, background_color); |
1593 } | 1595 } |
1594 } | 1596 } |
1595 | 1597 |
1596 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { | 1598 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { |
1597 omnibox_view_->SetUserText(new_value, new_value, true); | 1599 omnibox_view_->SetUserText(new_value, new_value, true); |
1598 } | 1600 } |
OLD | NEW |