Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 6278007: Remove wstring from TemplateURL and friends.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(keyword); 519 profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(
520 WideToUTF16Hack(keyword));
520 if (template_url && template_url->IsExtensionKeyword()) { 521 if (template_url && template_url->IsExtensionKeyword()) {
521 const SkBitmap& bitmap = profile_->GetExtensionService()-> 522 const SkBitmap& bitmap = profile_->GetExtensionService()->
522 GetOmniboxIcon(template_url->GetExtensionId()); 523 GetOmniboxIcon(template_url->GetExtensionId());
523 selected_keyword_view_->SetImage(bitmap); 524 selected_keyword_view_->SetImage(bitmap);
524 selected_keyword_view_->SetItemPadding(kExtensionItemPadding); 525 selected_keyword_view_->SetItemPadding(kExtensionItemPadding);
525 } else { 526 } else {
526 selected_keyword_view_->SetImage(*ResourceBundle::GetSharedInstance(). 527 selected_keyword_view_->SetImage(*ResourceBundle::GetSharedInstance().
527 GetBitmapNamed(IDR_OMNIBOX_SEARCH)); 528 GetBitmapNamed(IDR_OMNIBOX_SEARCH));
528 selected_keyword_view_->SetItemPadding(kItemPadding); 529 selected_keyword_view_->SetItemPadding(kItemPadding);
529 } 530 }
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 template_url_model_ = NULL; 1260 template_url_model_ = NULL;
1260 ShowFirstRunBubble(bubble_type_); 1261 ShowFirstRunBubble(bubble_type_);
1261 } 1262 }
1262 1263
1263 #if defined(OS_WIN) 1264 #if defined(OS_WIN)
1264 bool LocationBarView::HasValidSuggestText() { 1265 bool LocationBarView::HasValidSuggestText() {
1265 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && 1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() &&
1266 !suggested_text_view_->GetText().empty(); 1267 !suggested_text_view_->GetText().empty();
1267 } 1268 }
1268 #endif 1269 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698