| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // Make sure children with layers are clipped. See http://crbug.com/589497 | 214 // Make sure children with layers are clipped. See http://crbug.com/589497 |
| 215 SetPaintToLayer(true); | 215 SetPaintToLayer(true); |
| 216 layer()->SetFillsBoundsOpaquely(false); | 216 layer()->SetFillsBoundsOpaquely(false); |
| 217 layer()->SetMasksToBounds(true); | 217 layer()->SetMasksToBounds(true); |
| 218 | 218 |
| 219 // Determine the main font. | 219 // Determine the main font. |
| 220 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( | 220 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( |
| 221 ResourceBundle::BaseFont); | 221 ResourceBundle::BaseFont); |
| 222 const int current_font_size = font_list.GetFontSize(); | 222 const int current_font_size = font_list.GetFontSize(); |
| 223 const int desired_font_size = GetLayoutConstant(OMNIBOX_FONT_PIXEL_SIZE); | 223 const int kDesiredFontSize = 14; |
| 224 if (current_font_size != desired_font_size) { | 224 if (current_font_size != kDesiredFontSize) { |
| 225 font_list = | 225 font_list = |
| 226 font_list.DeriveWithSizeDelta(desired_font_size - current_font_size); | 226 font_list.DeriveWithSizeDelta(kDesiredFontSize - current_font_size); |
| 227 } | 227 } |
| 228 // Shrink large fonts to make them fit. | 228 // Shrink large fonts to make them fit. |
| 229 // TODO(pkasting): Stretch the location bar instead in this case. | 229 // TODO(pkasting): Stretch the location bar instead in this case. |
| 230 const int vertical_padding = GetTotalVerticalPadding(); | 230 const int vertical_padding = GetTotalVerticalPadding(); |
| 231 const int location_height = | 231 const int location_height = |
| 232 std::max(GetPreferredSize().height() - (vertical_padding * 2), 0); | 232 std::max(GetPreferredSize().height() - (vertical_padding * 2), 0); |
| 233 font_list = font_list.DeriveWithHeightUpperBound(location_height); | 233 font_list = font_list.DeriveWithHeightUpperBound(location_height); |
| 234 | 234 |
| 235 // Determine the font for use inside the bubbles. | 235 // Determine the font for use inside the bubbles. |
| 236 const int bubble_padding = | 236 const int bubble_padding = |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 // LocationBarView, private TemplateURLServiceObserver implementation: | 1261 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1262 | 1262 |
| 1263 void LocationBarView::OnTemplateURLServiceChanged() { | 1263 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1264 template_url_service_->RemoveObserver(this); | 1264 template_url_service_->RemoveObserver(this); |
| 1265 template_url_service_ = nullptr; | 1265 template_url_service_ = nullptr; |
| 1266 // If the browser is no longer active, let's not show the info bubble, as this | 1266 // If the browser is no longer active, let's not show the info bubble, as this |
| 1267 // would make the browser the active window again. | 1267 // would make the browser the active window again. |
| 1268 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1268 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1269 ShowFirstRunBubble(); | 1269 ShowFirstRunBubble(); |
| 1270 } | 1270 } |
| OLD | NEW |