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(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 return; | 509 return; |
510 const int available_width = AvailableWidth(max_edit_width); | 510 const int available_width = AvailableWidth(max_edit_width); |
511 | 511 |
512 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; | 512 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; |
513 selected_keyword_view_->SetVisible(show_selected_keyword); | 513 selected_keyword_view_->SetVisible(show_selected_keyword); |
514 keyword_hint_view_->SetVisible(show_keyword_hint); | 514 keyword_hint_view_->SetVisible(show_keyword_hint); |
515 if (show_selected_keyword) { | 515 if (show_selected_keyword) { |
516 if (selected_keyword_view_->keyword() != keyword) { | 516 if (selected_keyword_view_->keyword() != keyword) { |
517 selected_keyword_view_->SetKeyword(keyword); | 517 selected_keyword_view_->SetKeyword(keyword); |
518 const TemplateURL* template_url = | 518 const TemplateURL* template_url = |
519 profile_->GetTemplateURLModel()->GetTemplateURLForKeyword( | 519 profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword); |
520 WideToUTF16Hack(keyword)); | |
521 if (template_url && template_url->IsExtensionKeyword()) { | 520 if (template_url && template_url->IsExtensionKeyword()) { |
522 const SkBitmap& bitmap = profile_->GetExtensionService()-> | 521 const SkBitmap& bitmap = profile_->GetExtensionService()-> |
523 GetOmniboxIcon(template_url->GetExtensionId()); | 522 GetOmniboxIcon(template_url->GetExtensionId()); |
524 selected_keyword_view_->SetImage(bitmap); | 523 selected_keyword_view_->SetImage(bitmap); |
525 selected_keyword_view_->SetItemPadding(kExtensionItemPadding); | 524 selected_keyword_view_->SetItemPadding(kExtensionItemPadding); |
526 } else { | 525 } else { |
527 selected_keyword_view_->SetImage(*ResourceBundle::GetSharedInstance(). | 526 selected_keyword_view_->SetImage(*ResourceBundle::GetSharedInstance(). |
528 GetBitmapNamed(IDR_OMNIBOX_SEARCH)); | 527 GetBitmapNamed(IDR_OMNIBOX_SEARCH)); |
529 selected_keyword_view_->SetItemPadding(kItemPadding); | 528 selected_keyword_view_->SetItemPadding(kItemPadding); |
530 } | 529 } |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 template_url_model_ = NULL; | 1259 template_url_model_ = NULL; |
1261 ShowFirstRunBubble(bubble_type_); | 1260 ShowFirstRunBubble(bubble_type_); |
1262 } | 1261 } |
1263 | 1262 |
1264 #if defined(OS_WIN) | 1263 #if defined(OS_WIN) |
1265 bool LocationBarView::HasValidSuggestText() { | 1264 bool LocationBarView::HasValidSuggestText() { |
1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1265 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1267 !suggested_text_view_->GetText().empty(); | 1266 !suggested_text_view_->GetText().empty(); |
1268 } | 1267 } |
1269 #endif | 1268 #endif |
OLD | NEW |