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