summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 15:35:25 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 15:35:25 +0000
commite5366896e9ccb3dd17c590d115bd999e987a33af (patch)
tree52f4fc2f07b73aaca1199adb1384b123130c22ed /chrome/browser/automation
parentb133cc2db84fc83d5c4aa53020237788fa344c75 (diff)
downloadchromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.zip
chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.gz
chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.bz2
Replace wstring with string16 in history. The only time wstring is used now in history is for bookmark-related stuff (the bookmarks system is still wstring-based).
The substantial change here is in RTL to make a string16 variant of the functions and in changing the WordIterator to use string16 (this cleaned up some weird utf-32 code). TEST=none BUG=none Review URL: http://codereview.chromium.org/2808017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc13
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc6
2 files changed, 8 insertions, 11 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 3dccaaa..8c4b548 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1737,8 +1737,8 @@ void AutomationProvider::GetHistoryInfo(Browser* browser,
IPC::Message* reply_message) {
consumer_.CancelAllRequests();
- std::wstring search_text;
- args->GetString(L"search_text", &search_text);
+ string16 search_text;
+ args->GetString("search_text", &search_text);
// Fetch history.
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
@@ -1769,12 +1769,12 @@ void AutomationProvider::AddHistoryItem(Browser* browser,
DictionaryValue* item = NULL;
args->GetDictionary(L"item", &item);
string16 url_text;
- std::wstring title;
+ string16 title;
base::Time time = base::Time::Now();
if (item->GetString("url", &url_text)) {
GURL gurl(url_text);
- item->GetString(L"title", &title); // Don't care if it fails.
+ item->GetString("title", &title); // Don't care if it fails.
int it;
double dt;
if (item->GetInteger(L"time", &it))
@@ -1793,11 +1793,8 @@ void AutomationProvider::AddHistoryItem(Browser* browser,
PageTransition::LINK,
history::RedirectList(),
false);
- if (title.length()) {
- // TODO(jrg): add a string16 interface for
- // HistoryService::SetPageTitle(), then use it.
+ if (title.length())
hs->SetPageTitle(gurl, title);
- }
} else {
json_return = "{\"error\": \"bad args (no URL in dict?).\"}";
reply_return = false;
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 8b09fe5..0aa6488 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -990,11 +990,11 @@ void AutomationProviderHistoryObserver::HistoryQueryComplete(
for (size_t i = 0; i < results->size(); ++i) {
DictionaryValue* page_value = new DictionaryValue;
history::URLResult const &page = (*results)[i];
- page_value->SetString(L"title", page.title());
+ page_value->SetStringFromUTF16(L"title", page.title());
page_value->SetString(L"url", page.url().spec());
page_value->SetReal(L"time",
static_cast<double>(page.visit_time().ToDoubleT()));
- page_value->SetString(L"snippet", page.snippet().text());
+ page_value->SetStringFromUTF16(L"snippet", page.snippet().text());
page_value->SetBoolean(
L"starred",
provider_->profile()->GetBookmarkModel()->IsBookmarked(page.url()));