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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 6322001: 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autocomplete/autocomplete_edit.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 else if (!has_temporary_text_) 393 else if (!has_temporary_text_)
394 log->inline_autocompleted_length = inline_autocomplete_text_.length(); 394 log->inline_autocompleted_length = inline_autocomplete_text_.length();
395 NotificationService::current()->Notify( 395 NotificationService::current()->Notify(
396 NotificationType::OMNIBOX_OPENED_URL, Source<Profile>(profile_), 396 NotificationType::OMNIBOX_OPENED_URL, Source<Profile>(profile_),
397 Details<AutocompleteLog>(log.get())); 397 Details<AutocompleteLog>(log.get()));
398 } 398 }
399 399
400 TemplateURLModel* template_url_model = profile_->GetTemplateURLModel(); 400 TemplateURLModel* template_url_model = profile_->GetTemplateURLModel();
401 if (template_url_model && !keyword.empty()) { 401 if (template_url_model && !keyword.empty()) {
402 const TemplateURL* const template_url = 402 const TemplateURL* const template_url =
403 template_url_model->GetTemplateURLForKeyword(keyword); 403 template_url_model->GetTemplateURLForKeyword(WideToUTF16Hack(keyword));
404 404
405 // Special case for extension keywords. Don't increment usage count for 405 // Special case for extension keywords. Don't increment usage count for
406 // these. 406 // these.
407 if (template_url && template_url->IsExtensionKeyword()) { 407 if (template_url && template_url->IsExtensionKeyword()) {
408 AutocompleteMatch current_match; 408 AutocompleteMatch current_match;
409 GetInfoForCurrentText(&current_match, NULL); 409 GetInfoForCurrentText(&current_match, NULL);
410 410
411 const AutocompleteMatch& match = 411 const AutocompleteMatch& match =
412 index == AutocompletePopupModel::kNoMatch ? 412 index == AutocompletePopupModel::kNoMatch ?
413 current_match : result().match_at(index); 413 current_match : result().match_at(index);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 i->inline_autocomplete_offset != std::wstring::npos) { 827 i->inline_autocomplete_offset != std::wstring::npos) {
828 suggested_text = WideToUTF16(i->fill_into_edit.substr( 828 suggested_text = WideToUTF16(i->fill_into_edit.substr(
829 i->inline_autocomplete_offset)); 829 i->inline_autocomplete_offset));
830 break; 830 break;
831 } 831 }
832 } 832 }
833 } 833 }
834 } 834 }
835 controller_->OnSetSuggestedSearchText(suggested_text); 835 controller_->OnSetSuggestedSearchText(suggested_text);
836 } 836 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698