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

Unified Diff: chrome/browser/extensions/extension_bookmarks_module.cc

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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/extensions/extension_bookmarks_module.cc
===================================================================
--- chrome/browser/extensions/extension_bookmarks_module.cc (revision 54340)
+++ chrome/browser/extensions/extension_bookmarks_module.cc (working copy)
@@ -7,7 +7,7 @@
#include "base/json/json_writer.h"
#include "base/sha1.h"
#include "base/stl_util-inl.h"
-#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "chrome/browser/bookmarks/bookmark_codec.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
@@ -56,7 +56,7 @@
bool BookmarksFunction::GetBookmarkIdAsInt64(
const std::string& id_string, int64* id) {
- if (StringToInt64(id_string, id))
+ if (base::StringToInt64(id_string, id))
return true;
error_ = keys::kInvalidIdError;
@@ -112,12 +112,13 @@
int new_index) {
ListValue args;
const BookmarkNode* node = new_parent->GetChild(new_index);
- args.Append(new StringValue(Int64ToString(node->id())));
+ args.Append(new StringValue(base::Int64ToString(node->id())));
DictionaryValue* object_args = new DictionaryValue();
- object_args->SetString(keys::kParentIdKey, Int64ToString(new_parent->id()));
+ object_args->SetString(keys::kParentIdKey,
+ base::Int64ToString(new_parent->id()));
object_args->SetInteger(keys::kIndexKey, new_index);
object_args->SetString(keys::kOldParentIdKey,
- Int64ToString(old_parent->id()));
+ base::Int64ToString(old_parent->id()));
object_args->SetInteger(keys::kOldIndexKey, old_index);
args.Append(object_args);
@@ -131,7 +132,7 @@
int index) {
ListValue args;
const BookmarkNode* node = parent->GetChild(index);
- args.Append(new StringValue(Int64ToString(node->id())));
+ args.Append(new StringValue(base::Int64ToString(node->id())));
DictionaryValue* obj =
extension_bookmark_helpers::GetNodeDictionary(node, false, false);
args.Append(obj);
@@ -147,9 +148,10 @@
int index,
const BookmarkNode* node) {
ListValue args;
- args.Append(new StringValue(Int64ToString(node->id())));
+ args.Append(new StringValue(base::Int64ToString(node->id())));
DictionaryValue* object_args = new DictionaryValue();
- object_args->SetString(keys::kParentIdKey, Int64ToString(parent->id()));
+ object_args->SetString(keys::kParentIdKey,
+ base::Int64ToString(parent->id()));
object_args->SetInteger(keys::kIndexKey, index);
args.Append(object_args);
@@ -161,7 +163,7 @@
void ExtensionBookmarkEventRouter::BookmarkNodeChanged(
BookmarkModel* model, const BookmarkNode* node) {
ListValue args;
- args.Append(new StringValue(Int64ToString(node->id())));
+ args.Append(new StringValue(base::Int64ToString(node->id())));
// TODO(erikkay) The only three things that BookmarkModel sends this
// notification for are title, url and favicon. Since we're currently
@@ -187,12 +189,12 @@
void ExtensionBookmarkEventRouter::BookmarkNodeChildrenReordered(
BookmarkModel* model, const BookmarkNode* node) {
ListValue args;
- args.Append(new StringValue(Int64ToString(node->id())));
+ args.Append(new StringValue(base::Int64ToString(node->id())));
int childCount = node->GetChildCount();
ListValue* children = new ListValue();
for (int i = 0; i < childCount; ++i) {
const BookmarkNode* child = node->GetChild(i);
- Value* child_id = new StringValue(Int64ToString(child->id()));
+ Value* child_id = new StringValue(base::Int64ToString(child->id()));
children->Append(child_id);
}
DictionaryValue* reorder_info = new DictionaryValue();
@@ -347,7 +349,7 @@
if (!args->GetString(0, &id_string))
return false;
int64 id;
- if (StringToInt64(id_string, &id))
+ if (base::StringToInt64(id_string, &id))
ids->push_back(id);
else
*invalid_id = true;
@@ -618,7 +620,10 @@
return;
}
BookmarkModel* model = profile_->GetBookmarkModel();
- const BookmarkNode* parent = model->GetNodeByID(StringToInt64(parent_id));
+
+ int64 parent_id_int64;
+ base::StringToInt64(parent_id, &parent_id_int64);
+ const BookmarkNode* parent = model->GetNodeByID(parent_id_int64);
if (!parent)
return;
« no previous file with comments | « chrome/browser/extensions/extension_bookmark_manager_api.cc ('k') | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698