| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (template_url_model_) | 123 if (template_url_model_) |
| 124 template_url_model_->RemoveObserver(this); | 124 template_url_model_->RemoveObserver(this); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void LocationBarView::Init() { | 127 void LocationBarView::Init() { |
| 128 if (mode_ == POPUP) { | 128 if (mode_ == POPUP) { |
| 129 font_ = ResourceBundle::GetSharedInstance().GetFont( | 129 font_ = ResourceBundle::GetSharedInstance().GetFont( |
| 130 ResourceBundle::BaseFont); | 130 ResourceBundle::BaseFont); |
| 131 } else { | 131 } else { |
| 132 // Use a larger version of the system font. | 132 // Use a larger version of the system font. |
| 133 font_ = font_.DeriveFont(3); | 133 font_ = ResourceBundle::GetSharedInstance().GetFont( |
| 134 ResourceBundle::MediumFont); |
| 134 } | 135 } |
| 135 | 136 |
| 136 // If this makes the font too big, try to make it smaller so it will fit. | 137 // If this makes the font too big, try to make it smaller so it will fit. |
| 137 const int height = | 138 const int height = |
| 138 std::max(GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0); | 139 std::max(GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0); |
| 139 while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1)) | 140 while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1)) |
| 140 font_ = font_.DeriveFont(-1); | 141 font_ = font_.DeriveFont(-1); |
| 141 | 142 |
| 142 location_icon_view_ = new LocationIconView(this); | 143 location_icon_view_ = new LocationIconView(this); |
| 143 AddChildView(location_icon_view_); | 144 AddChildView(location_icon_view_); |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 } | 1228 } |
| 1228 | 1229 |
| 1229 NOTREACHED(); | 1230 NOTREACHED(); |
| 1230 } | 1231 } |
| 1231 | 1232 |
| 1232 void LocationBarView::OnTemplateURLModelChanged() { | 1233 void LocationBarView::OnTemplateURLModelChanged() { |
| 1233 template_url_model_->RemoveObserver(this); | 1234 template_url_model_->RemoveObserver(this); |
| 1234 template_url_model_ = NULL; | 1235 template_url_model_ = NULL; |
| 1235 ShowFirstRunBubble(bubble_type_); | 1236 ShowFirstRunBubble(bubble_type_); |
| 1236 } | 1237 } |
| OLD | NEW |