| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 font_ = ResourceBundle::GetSharedInstance().GetFont( | 111 font_ = ResourceBundle::GetSharedInstance().GetFont( |
| 112 ResourceBundle::BaseFont); | 112 ResourceBundle::BaseFont); |
| 113 } else { | 113 } else { |
| 114 // Use a larger version of the system font. | 114 // Use a larger version of the system font. |
| 115 font_ = font_.DeriveFont(3); | 115 font_ = font_.DeriveFont(3); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // If this makes the font too big, try to make it smaller so it will fit. | 118 // If this makes the font too big, try to make it smaller so it will fit. |
| 119 const int height = | 119 const int height = |
| 120 std::max(GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0); | 120 std::max(GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0); |
| 121 while ((font_.height() > height) && (font_.FontSize() > 1)) | 121 while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1)) |
| 122 font_ = font_.DeriveFont(-1); | 122 font_ = font_.DeriveFont(-1); |
| 123 | 123 |
| 124 location_icon_view_ = new LocationIconView(this); | 124 location_icon_view_ = new LocationIconView(this); |
| 125 AddChildView(location_icon_view_); | 125 AddChildView(location_icon_view_); |
| 126 location_icon_view_->SetVisible(true); | 126 location_icon_view_->SetVisible(true); |
| 127 location_icon_view_->SetDragController(this); | 127 location_icon_view_->SetDragController(this); |
| 128 | 128 |
| 129 ev_bubble_view_ = | 129 ev_bubble_view_ = |
| 130 new EVBubbleView(kEVBubbleBackgroundImages, IDR_OMNIBOX_HTTPS_VALID, | 130 new EVBubbleView(kEVBubbleBackgroundImages, IDR_OMNIBOX_HTTPS_VALID, |
| 131 GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), this); | 131 GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), this); |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 | 1062 |
| 1063 NOTREACHED(); | 1063 NOTREACHED(); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 void LocationBarView::OnTemplateURLModelChanged() { | 1066 void LocationBarView::OnTemplateURLModelChanged() { |
| 1067 template_url_model_->RemoveObserver(this); | 1067 template_url_model_->RemoveObserver(this); |
| 1068 template_url_model_ = NULL; | 1068 template_url_model_ = NULL; |
| 1069 ShowFirstRunBubble(bubble_type_); | 1069 ShowFirstRunBubble(bubble_type_); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| OLD | NEW |