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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 Initialize(id); 67 Initialize(id);
68 } 68 }
69 69
70 BookmarkNode::~BookmarkNode() { 70 BookmarkNode::~BookmarkNode() {
71 } 71 }
72 72
73 void BookmarkNode::SetTitle(const string16& title) { 73 void BookmarkNode::SetTitle(const string16& title) {
74 // Replace newlines and other problematic whitespace characters in 74 // Replace newlines and other problematic whitespace characters in
75 // folder/bookmark names with spaces. 75 // folder/bookmark names with spaces.
76 string16 trimmed_title; 76 string16 trimmed_title;
77 ReplaceChars(title, kInvalidChars, ASCIIToUTF16(" "), &trimmed_title); 77 base::ReplaceChars(title, kInvalidChars, ASCIIToUTF16(" "), &trimmed_title);
78 ui::TreeNode<BookmarkNode>::SetTitle(trimmed_title); 78 ui::TreeNode<BookmarkNode>::SetTitle(trimmed_title);
79 } 79 }
80 80
81 bool BookmarkNode::IsVisible() const { 81 bool BookmarkNode::IsVisible() const {
82 return true; 82 return true;
83 } 83 }
84 84
85 bool BookmarkNode::GetMetaInfo(const std::string& key, 85 bool BookmarkNode::GetMetaInfo(const std::string& key,
86 std::string* value) const { 86 std::string* value) const {
87 if (!meta_info_map_) 87 if (!meta_info_map_)
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 BookmarkPermanentNode* bb_node = 1058 BookmarkPermanentNode* bb_node =
1059 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); 1059 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR);
1060 BookmarkPermanentNode* other_node = 1060 BookmarkPermanentNode* other_node =
1061 CreatePermanentNode(BookmarkNode::OTHER_NODE); 1061 CreatePermanentNode(BookmarkNode::OTHER_NODE);
1062 BookmarkPermanentNode* mobile_node = 1062 BookmarkPermanentNode* mobile_node =
1063 CreatePermanentNode(BookmarkNode::MOBILE); 1063 CreatePermanentNode(BookmarkNode::MOBILE);
1064 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, 1064 return new BookmarkLoadDetails(bb_node, other_node, mobile_node,
1065 new BookmarkIndex(profile_), 1065 new BookmarkIndex(profile_),
1066 next_node_id_); 1066 next_node_id_);
1067 } 1067 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698