summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/extension_bookmark_helpers.cc2
-rw-r--r--chrome/browser/extensions/extension_bookmark_manager_api.cc4
-rw-r--r--chrome/browser/extensions/extension_bookmarks_module.cc11
-rw-r--r--chrome/browser/extensions/extension_bookmarks_module_constants.cc30
-rw-r--r--chrome/browser/extensions/extension_bookmarks_module_constants.h30
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc1
6 files changed, 39 insertions, 39 deletions
diff --git a/chrome/browser/extensions/extension_bookmark_helpers.cc b/chrome/browser/extensions/extension_bookmark_helpers.cc
index ad7cbb0..25c24a0 100644
--- a/chrome/browser/extensions/extension_bookmark_helpers.cc
+++ b/chrome/browser/extensions/extension_bookmark_helpers.cc
@@ -36,7 +36,7 @@ DictionaryValue* GetNodeDictionary(const BookmarkNode* node,
dict->SetReal(keys::kDateGroupModifiedKey, floor(t.ToDoubleT() * 1000));
}
- dict->SetString(keys::kTitleKey, node->GetTitle());
+ dict->SetString(keys::kTitleKey, node->GetTitleAsString16());
if (!node->date_added().is_null()) {
// Javascript Date wants milliseconds since the epoch, ToDoubleT is
// seconds.
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc
index 19699f4..c6792bb 100644
--- a/chrome/browser/extensions/extension_bookmark_manager_api.cc
+++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc
@@ -86,7 +86,7 @@ void AddNodeToList(ListValue* list, const BookmarkNode& node) {
if (node.is_url())
dict->SetString(keys::kUrlKey, node.GetURL().spec());
- dict->SetString(keys::kTitleKey, node.GetTitle());
+ dict->SetString(keys::kTitleKey, node.GetTitleAsString16());
ListValue* children = new ListValue();
for (int i = 0; i < node.GetChildCount(); ++i)
@@ -106,7 +106,7 @@ void AddElementToList(ListValue* list,
if (element.is_url)
dict->SetString(keys::kUrlKey, element.url.spec());
- dict->SetString(keys::kTitleKey, UTF16ToWide(element.title));
+ dict->SetString(keys::kTitleKey, element.title);
ListValue* children = new ListValue();
for (size_t i = 0; i < element.children.size(); ++i)
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc
index b819217..b8f9119 100644
--- a/chrome/browser/extensions/extension_bookmarks_module.cc
+++ b/chrome/browser/extensions/extension_bookmarks_module.cc
@@ -7,6 +7,7 @@
#include "base/json/json_writer.h"
#include "base/sha1.h"
#include "base/stl_util-inl.h"
+#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "chrome/browser/bookmarks/bookmark_codec.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
@@ -171,7 +172,7 @@ void ExtensionBookmarkEventRouter::BookmarkNodeChanged(
// for now we only include title and url. The ideal thing would be to change
// BookmarkModel to indicate what changed.
DictionaryValue* object_args = new DictionaryValue();
- object_args->SetString(keys::kTitleKey, node->GetTitle());
+ object_args->SetString(keys::kTitleKey, node->GetTitleAsString16());
if (node->is_url())
object_args->SetString(keys::kUrlKey, node->GetURL().spec());
args.Append(object_args);
@@ -416,7 +417,7 @@ bool CreateBookmarkFunction::RunImpl() {
}
}
- std::wstring title;
+ string16 title;
json->GetString(keys::kTitleKey, &title); // Optional.
std::string url_string;
json->GetString(keys::kUrlKey, &url_string); // Optional.
@@ -544,7 +545,7 @@ bool UpdateBookmarkFunction::RunImpl() {
DictionaryValue* updates;
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &updates));
- std::wstring title;
+ string16 title;
std::string url_string;
// Optional but we need to distinguish non present from an empty title.
@@ -628,12 +629,12 @@ class CreateBookmarkBucketMapper : public BookmarkBucketMapper<std::string> {
return;
std::string bucket_id = WideToUTF8(parent->GetTitle());
- std::wstring title;
+ std::string title;
json->GetString(keys::kTitleKey, &title);
std::string url_string;
json->GetString(keys::kUrlKey, &url_string);
- bucket_id += WideToUTF8(title);
+ bucket_id += title;
bucket_id += url_string;
// 20 bytes (SHA1 hash length) is very likely less than most of the
// |bucket_id| strings we construct here, so we hash it to save space.
diff --git a/chrome/browser/extensions/extension_bookmarks_module_constants.cc b/chrome/browser/extensions/extension_bookmarks_module_constants.cc
index 0fcb74b..670b5ec 100644
--- a/chrome/browser/extensions/extension_bookmarks_module_constants.cc
+++ b/chrome/browser/extensions/extension_bookmarks_module_constants.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.
@@ -6,21 +6,21 @@
namespace extension_bookmarks_module_constants {
-const wchar_t kIdKey[] = L"id";
-const wchar_t kIndexKey[] = L"index";
-const wchar_t kParentIdKey[] = L"parentId";
-const wchar_t kOldIndexKey[] = L"oldIndex";
-const wchar_t kOldParentIdKey[] = L"oldParentId";
-const wchar_t kUrlKey[] = L"url";
-const wchar_t kTitleKey[] = L"title";
-const wchar_t kChildrenKey[] = L"children";
-const wchar_t kChildIdsKey[] = L"childIds";
-const wchar_t kRecursiveKey[] = L"recursive";
-const wchar_t kDateAddedKey[] = L"dateAdded";
-const wchar_t kDateGroupModifiedKey[] = L"dateGroupModified";
+const char kIdKey[] = "id";
+const char kIndexKey[] = "index";
+const char kParentIdKey[] = "parentId";
+const char kOldIndexKey[] = "oldIndex";
+const char kOldParentIdKey[] = "oldParentId";
+const char kUrlKey[] = "url";
+const char kTitleKey[] = "title";
+const char kChildrenKey[] = "children";
+const char kChildIdsKey[] = "childIds";
+const char kRecursiveKey[] = "recursive";
+const char kDateAddedKey[] = "dateAdded";
+const char kDateGroupModifiedKey[] = "dateGroupModified";
// TODO(arv): Move bookmark manager related constants out of this file.
-const wchar_t kSameProfileKey[] = L"sameProfile";
-const wchar_t kElementsKey[] = L"elements";
+const char kSameProfileKey[] = "sameProfile";
+const char kElementsKey[] = "elements";
const char kNoNodeError[] = "Can't find bookmark for id.";
const char kNoParentError[] = "Can't find parent bookmark for id.";
diff --git a/chrome/browser/extensions/extension_bookmarks_module_constants.h b/chrome/browser/extensions/extension_bookmarks_module_constants.h
index 8c2f8fb..27de3a0 100644
--- a/chrome/browser/extensions/extension_bookmarks_module_constants.h
+++ b/chrome/browser/extensions/extension_bookmarks_module_constants.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.
@@ -11,21 +11,21 @@
namespace extension_bookmarks_module_constants {
// Keys.
-extern const wchar_t kIdKey[];
-extern const wchar_t kIndexKey[];
-extern const wchar_t kParentIdKey[];
-extern const wchar_t kOldIndexKey[];
-extern const wchar_t kOldParentIdKey[];
-extern const wchar_t kUrlKey[];
-extern const wchar_t kTitleKey[];
-extern const wchar_t kChildrenKey[];
-extern const wchar_t kChildIdsKey[];
-extern const wchar_t kRecursiveKey[];
-extern const wchar_t kDateAddedKey[];
-extern const wchar_t kDateGroupModifiedKey[];
+extern const char kIdKey[];
+extern const char kIndexKey[];
+extern const char kParentIdKey[];
+extern const char kOldIndexKey[];
+extern const char kOldParentIdKey[];
+extern const char kUrlKey[];
+extern const char kTitleKey[];
+extern const char kChildrenKey[];
+extern const char kChildIdsKey[];
+extern const char kRecursiveKey[];
+extern const char kDateAddedKey[];
+extern const char kDateGroupModifiedKey[];
// TODO(arv): Move bookmark manager related constants out of this file.
-extern const wchar_t kSameProfileKey[];
-extern const wchar_t kElementsKey[];
+extern const char kSameProfileKey[];
+extern const char kElementsKey[];
// Errors.
extern const char kNoNodeError[];
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index a4c255a..752f886 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/extensions/extension_accessibility_api.h"
#include "chrome/browser/extensions/extension_bookmark_manager_api.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
-#include "chrome/browser/extensions/extension_bookmarks_module_constants.h"
#include "chrome/browser/extensions/extension_browser_actions_api.h"
#include "chrome/browser/extensions/extension_clipboard_api.h"
#include "chrome/browser/extensions/extension_context_menu_api.h"