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

Unified Diff: chrome/browser/search_engines/template_url_fetcher.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search_engines/template_url_fetcher.cc
===================================================================
--- chrome/browser/search_engines/template_url_fetcher.cc (revision 71269)
+++ chrome/browser/search_engines/template_url_fetcher.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,7 +26,7 @@
public:
// Takes ownership of |callbacks|.
RequestDelegate(TemplateURLFetcher* fetcher,
- const std::wstring& keyword,
+ const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
TemplateURLFetcherCallbacks* callbacks,
@@ -48,10 +48,10 @@
const std::string& data);
// URL of the OSDD.
- const GURL& url() const { return osdd_url_; }
+ GURL url() const { return osdd_url_; }
// Keyword to use.
- const std::wstring keyword() const { return keyword_; }
+ string16 keyword() const { return keyword_; }
// The type of search provider being fetched.
ProviderType provider_type() const { return provider_type_; }
@@ -62,7 +62,7 @@
URLFetcher url_fetcher_;
TemplateURLFetcher* fetcher_;
scoped_ptr<TemplateURL> template_url_;
- std::wstring keyword_;
+ string16 keyword_;
const GURL osdd_url_;
const GURL favicon_url_;
const ProviderType provider_type_;
@@ -76,7 +76,7 @@
TemplateURLFetcher::RequestDelegate::RequestDelegate(
TemplateURLFetcher* fetcher,
- const std::wstring& keyword,
+ const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
TemplateURLFetcherCallbacks* callbacks,
@@ -160,7 +160,7 @@
// it gives wrong result when OSDD is located on third party site that
// has nothing in common with search engine in OSDD.
GURL keyword_url(template_url_->url()->url());
- std::wstring new_keyword = TemplateURLModel::GenerateKeyword(
+ string16 new_keyword = TemplateURLModel::GenerateKeyword(
keyword_url, false);
if (!new_keyword.empty())
keyword_ = new_keyword;
@@ -183,13 +183,13 @@
// provider. The keyword isn't as important in this case.
if (provider_type_ == EXPLICIT_DEFAULT_PROVIDER) {
// The loop numbers are arbitrary and are simply a strong effort.
- std::wstring new_keyword;
+ string16 new_keyword;
for (int i = 0; i < 100; ++i) {
// Concatenate a number at end of the keyword and try that.
new_keyword = keyword_;
// Try the keyword alone the first time
if (i > 0)
- new_keyword.append(UTF16ToWide(base::IntToString16(i)));
+ new_keyword.append(base::IntToString16(i));
if (!model->GetTemplateURLForKeyword(new_keyword) ||
model->CanReplaceKeyword(new_keyword,
GURL(template_url_->url()->url()),
@@ -268,7 +268,7 @@
}
void TemplateURLFetcher::ScheduleDownload(
- const std::wstring& keyword,
+ const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
TemplateURLFetcherCallbacks* callbacks,
« no previous file with comments | « chrome/browser/search_engines/template_url_fetcher.h ('k') | chrome/browser/search_engines/template_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698