| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 location_icon_view_ = new LocationIconView(this); | 255 location_icon_view_ = new LocationIconView(this); |
| 256 location_icon_view_->set_drag_controller(this); | 256 location_icon_view_->set_drag_controller(this); |
| 257 AddChildView(location_icon_view_); | 257 AddChildView(location_icon_view_); |
| 258 | 258 |
| 259 // Determine the main font. | 259 // Determine the main font. |
| 260 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( | 260 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( |
| 261 ResourceBundle::BaseFont); | 261 ResourceBundle::BaseFont); |
| 262 const int current_font_size = font_list.GetFontSize(); | 262 const int current_font_size = font_list.GetFontSize(); |
| 263 const int desired_font_size = browser_defaults::kOmniboxFontPixelSize; | 263 const int desired_font_size = browser_defaults::kOmniboxFontPixelSize; |
| 264 if (current_font_size < desired_font_size) | 264 if (current_font_size != desired_font_size) { |
| 265 font_list = font_list.DeriveFontListWithSize(desired_font_size); | 265 font_list = |
| 266 font_list.DeriveWithSizeDelta(desired_font_size - current_font_size); |
| 267 } |
| 266 // Shrink large fonts to make them fit. | 268 // Shrink large fonts to make them fit. |
| 267 // TODO(pkasting): Stretch the location bar instead in this case. | 269 // TODO(pkasting): Stretch the location bar instead in this case. |
| 268 const int location_height = GetInternalHeight(true); | 270 const int location_height = GetInternalHeight(true); |
| 269 font_list = GetLargestFontListWithHeightBound(font_list, location_height); | 271 font_list = GetLargestFontListWithHeightBound(font_list, location_height); |
| 270 | 272 |
| 271 // Determine the font for use inside the bubbles. The bubble background | 273 // Determine the font for use inside the bubbles. The bubble background |
| 272 // images have 1 px thick edges, which we don't want to overlap. | 274 // images have 1 px thick edges, which we don't want to overlap. |
| 273 const int kBubbleInteriorVerticalPadding = 1; | 275 const int kBubbleInteriorVerticalPadding = 1; |
| 274 const int bubble_vertical_padding = | 276 const int bubble_vertical_padding = |
| 275 (kBubblePadding + kBubbleInteriorVerticalPadding) * 2; | 277 (kBubblePadding + kBubbleInteriorVerticalPadding) * 2; |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1544 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
| 1543 location_bar_util::PaintExtensionActionBackground( | 1545 location_bar_util::PaintExtensionActionBackground( |
| 1544 *(*page_action_view)->image_view()->page_action(), | 1546 *(*page_action_view)->image_view()->page_action(), |
| 1545 tab_id, canvas, bounds, text_color, background_color); | 1547 tab_id, canvas, bounds, text_color, background_color); |
| 1546 } | 1548 } |
| 1547 } | 1549 } |
| 1548 | 1550 |
| 1549 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { | 1551 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { |
| 1550 omnibox_view_->SetUserText(new_value, new_value, true); | 1552 omnibox_view_->SetUserText(new_value, new_value, true); |
| 1551 } | 1553 } |
| OLD | NEW |