| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 location_icon_view_->SetVisible(false); | 484 location_icon_view_->SetVisible(false); |
| 485 ev_bubble_view_->SetVisible(false); | 485 ev_bubble_view_->SetVisible(false); |
| 486 const string16 keyword(location_entry_->model()->keyword()); | 486 const string16 keyword(location_entry_->model()->keyword()); |
| 487 const bool is_keyword_hint(location_entry_->model()->is_keyword_hint()); | 487 const bool is_keyword_hint(location_entry_->model()->is_keyword_hint()); |
| 488 const bool show_selected_keyword = !keyword.empty() && !is_keyword_hint; | 488 const bool show_selected_keyword = !keyword.empty() && !is_keyword_hint; |
| 489 if (show_selected_keyword) { | 489 if (show_selected_keyword) { |
| 490 // Assume the keyword might be hidden. | 490 // Assume the keyword might be hidden. |
| 491 entry_width -= (kEdgeThickness + kEdgeEditPadding); | 491 entry_width -= (kEdgeThickness + kEdgeEditPadding); |
| 492 } else if (model_->GetSecurityLevel() == ToolbarModel::EV_SECURE) { | 492 } else if (model_->GetSecurityLevel() == ToolbarModel::EV_SECURE) { |
| 493 ev_bubble_view_->SetVisible(true); | 493 ev_bubble_view_->SetVisible(true); |
| 494 ev_bubble_view_->SetLabel(model_->GetEVCertName()); | 494 ev_bubble_view_->SetLabel(UTF16ToWideHack(model_->GetEVCertName())); |
| 495 ev_bubble_width = ev_bubble_view_->GetPreferredSize().width(); | 495 ev_bubble_width = ev_bubble_view_->GetPreferredSize().width(); |
| 496 // We'll adjust this width and take it out of |entry_width| below. | 496 // We'll adjust this width and take it out of |entry_width| below. |
| 497 } else { | 497 } else { |
| 498 location_icon_view_->SetVisible(true); | 498 location_icon_view_->SetVisible(true); |
| 499 location_icon_width = location_icon_view_->GetPreferredSize().width(); | 499 location_icon_width = location_icon_view_->GetPreferredSize().width(); |
| 500 entry_width -= (kEdgeThickness + kEdgeItemPadding + location_icon_width + | 500 entry_width -= (kEdgeThickness + kEdgeItemPadding + location_icon_width + |
| 501 kItemEditPadding); | 501 kItemEditPadding); |
| 502 } | 502 } |
| 503 | 503 |
| 504 if (star_view_ && star_view_->IsVisible()) | 504 if (star_view_ && star_view_->IsVisible()) |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 bool LocationBarView::HasValidSuggestText() const { | 1239 bool LocationBarView::HasValidSuggestText() const { |
| 1240 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1240 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
| 1241 !suggested_text_view_->GetText().empty(); | 1241 !suggested_text_view_->GetText().empty(); |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1244 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
| 1245 CHECK(!views::Widget::IsPureViews()); | 1245 CHECK(!views::Widget::IsPureViews()); |
| 1246 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1246 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
| 1247 } | 1247 } |
| 1248 #endif | 1248 #endif |
| OLD | NEW |