summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_resource
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 16:11:10 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 16:11:10 +0000
commitcd4bcde2bc5243828845ad57dae062648ece19d3 (patch)
tree0d078a7c18795c04a0967cc29af3b5144b1aa870 /chrome/browser/web_resource
parent5f2b0eea5fafc69230670ce92134ab946b3b906d (diff)
downloadchromium_src-cd4bcde2bc5243828845ad57dae062648ece19d3.zip
chromium_src-cd4bcde2bc5243828845ad57dae062648ece19d3.tar.gz
chromium_src-cd4bcde2bc5243828845ad57dae062648ece19d3.tar.bz2
Convert wide strings in WebResourceService.
BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3130020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource')
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc21
-rw-r--r--chrome/browser/web_resource/web_resource_service.h7
2 files changed, 14 insertions, 14 deletions
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 860c44d..7b697ac 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -1,6 +1,7 @@
-// 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.
+
#include "chrome/browser/web_resource/web_resource_service.h"
#include "base/command_line.h"
@@ -19,8 +20,8 @@
#include "net/base/load_flags.h"
#include "net/url_request/url_request_status.h"
-const wchar_t* WebResourceService::kCurrentTipPrefName = L"current_tip";
-const wchar_t* WebResourceService::kTipCachePrefName = L"tips";
+const char* WebResourceService::kCurrentTipPrefName = "current_tip";
+const char* WebResourceService::kTipCachePrefName = "tips";
class WebResourceService::WebResourceFetcher
: public URLFetcher::Delegate {
@@ -238,21 +239,21 @@ void WebResourceService::OnWebResourceUnpacked(
DictionaryValue* topic_dict;
ListValue* answer_list;
- std::wstring topic_id;
- std::wstring inproduct;
+ std::string topic_id;
+ std::string inproduct;
int tip_counter = 0;
- if (parsed_json.GetDictionary(L"topic", &topic_dict)) {
- if (topic_dict->GetString(L"topic_id", &topic_id))
- web_resource_cache_->SetString(L"topic_id", topic_id);
- if (topic_dict->GetList(L"answers", &answer_list)) {
+ if (parsed_json.GetDictionary("topic", &topic_dict)) {
+ if (topic_dict->GetString("topic_id", &topic_id))
+ web_resource_cache_->SetString("topic_id", topic_id);
+ if (topic_dict->GetList("answers", &answer_list)) {
for (ListValue::const_iterator tip_iter = answer_list->begin();
tip_iter != answer_list->end(); ++tip_iter) {
if (!(*tip_iter)->IsType(Value::TYPE_DICTIONARY))
continue;
DictionaryValue* a_dic =
static_cast<DictionaryValue*>(*tip_iter);
- if (a_dic->GetString(L"inproduct", &inproduct)) {
+ if (a_dic->GetString("inproduct", &inproduct)) {
tip_holder->Append(Value::CreateStringValue(inproduct));
}
tip_counter++;
diff --git a/chrome/browser/web_resource/web_resource_service.h b/chrome/browser/web_resource/web_resource_service.h
index 6a0f9fb..5604eec 100644
--- a/chrome/browser/web_resource/web_resource_service.h
+++ b/chrome/browser/web_resource/web_resource_service.h
@@ -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.
@@ -27,9 +27,8 @@ class WebResourceService
// the process that will parse the JSON, and then update the cache.
void UpdateResourceCache(const std::string& json_data);
- static const wchar_t* kTipDictionaryPrefName;
- static const wchar_t* kCurrentTipPrefName;
- static const wchar_t* kTipCachePrefName;
+ static const char* kCurrentTipPrefName;
+ static const char* kTipCachePrefName;
// Default server from which to gather resources.
static const char* kDefaultResourceServer;