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

Side by Side Diff: components/bookmarks/browser/bookmark_utils.cc

Issue 870293002: bookmarks: BookmarkNodeData's size() cleanups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 10 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
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data_views.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_utils.h" 5 #include "components/bookmarks/browser/bookmark_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (!url.is_valid()) 251 if (!url.is_valid())
252 return; 252 return;
253 BookmarkNode node(url); 253 BookmarkNode node(url);
254 node.SetTitle(base::ASCIIToUTF16(url.spec())); 254 node.SetTitle(base::ASCIIToUTF16(url.spec()));
255 bookmark_data = BookmarkNodeData(&node); 255 bookmark_data = BookmarkNodeData(&node);
256 } 256 }
257 if (index == -1) 257 if (index == -1)
258 index = parent->child_count(); 258 index = parent->child_count();
259 ScopedGroupBookmarkActions group_paste(model); 259 ScopedGroupBookmarkActions group_paste(model);
260 260
261 if (bookmark_data.elements.size() == 1 && 261 if (bookmark_data.size() == 1 &&
262 model->IsBookmarked(bookmark_data.elements[0].url)) { 262 model->IsBookmarked(bookmark_data.elements[0].url)) {
263 MakeTitleUnique(model, 263 MakeTitleUnique(model,
264 parent, 264 parent,
265 bookmark_data.elements[0].url, 265 bookmark_data.elements[0].url,
266 &bookmark_data.elements[0].title); 266 &bookmark_data.elements[0].title);
267 } 267 }
268 268
269 CloneBookmarkNode(model, bookmark_data.elements, parent, index, true); 269 CloneBookmarkNode(model, bookmark_data.elements, parent, index, true);
270 } 270 }
271 271
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 return false; 505 return false;
506 } 506 }
507 507
508 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) { 508 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) {
509 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate. 509 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate.
510 return GetNodeByID(model->root_node(), id); 510 return GetNodeByID(model->root_node(), id);
511 } 511 }
512 512
513 } // namespace bookmarks 513 } // namespace bookmarks
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698