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

Side by Side Diff: chrome/browser/extensions/extension_bookmark_helpers.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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_bookmark_helpers.h" 5 #include "chrome/browser/extensions/extension_bookmark_helpers.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_number_conversions.h"
8 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" 8 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h"
9 9
10 namespace keys = extension_bookmarks_module_constants; 10 namespace keys = extension_bookmarks_module_constants;
11 11
12 // Helper functions. 12 // Helper functions.
13 namespace extension_bookmark_helpers { 13 namespace extension_bookmark_helpers {
14 14
15 DictionaryValue* GetNodeDictionary(const BookmarkNode* node, 15 DictionaryValue* GetNodeDictionary(const BookmarkNode* node,
16 bool recurse, 16 bool recurse,
17 bool only_folders) { 17 bool only_folders) {
18 DictionaryValue* dict = new DictionaryValue(); 18 DictionaryValue* dict = new DictionaryValue();
19 dict->SetString(keys::kIdKey, Int64ToString(node->id())); 19 dict->SetString(keys::kIdKey, base::Int64ToString(node->id()));
20 20
21 const BookmarkNode* parent = node->GetParent(); 21 const BookmarkNode* parent = node->GetParent();
22 if (parent) { 22 if (parent) {
23 dict->SetString(keys::kParentIdKey, Int64ToString(parent->id())); 23 dict->SetString(keys::kParentIdKey, base::Int64ToString(parent->id()));
24 dict->SetInteger(keys::kIndexKey, parent->IndexOfChild(node)); 24 dict->SetInteger(keys::kIndexKey, parent->IndexOfChild(node));
25 } 25 }
26 26
27 if (!node->is_folder()) { 27 if (!node->is_folder()) {
28 dict->SetString(keys::kUrlKey, node->GetURL().spec()); 28 dict->SetString(keys::kUrlKey, node->GetURL().spec());
29 } else { 29 } else {
30 // Javascript Date wants milliseconds since the epoch, ToDoubleT is 30 // Javascript Date wants milliseconds since the epoch, ToDoubleT is
31 // seconds. 31 // seconds.
32 base::Time t = node->date_group_modified(); 32 base::Time t = node->date_group_modified();
33 if (!t.is_null()) 33 if (!t.is_null())
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return false; 98 return false;
99 } 99 }
100 100
101 const BookmarkNode* parent = node->GetParent(); 101 const BookmarkNode* parent = node->GetParent();
102 int index = parent->IndexOfChild(node); 102 int index = parent->IndexOfChild(node);
103 model->Remove(parent, index); 103 model->Remove(parent, index);
104 return true; 104 return true;
105 } 105 }
106 106
107 } 107 }
OLDNEW
« no previous file with comments | « chrome/browser/download/drag_download_util.cc ('k') | chrome/browser/extensions/extension_bookmark_manager_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698