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

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

Issue 308273002: Made the bookmarks extension APIs aware of managed bookmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 6 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 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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 GURL(TruncateUrl(gurl.spec())), languages, 408 GURL(TruncateUrl(gurl.spec())), languages,
409 net::kFormatUrlOmitUsernamePassword, 409 net::kFormatUrlOmitUsernamePassword,
410 net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS, 410 net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS,
411 NULL, NULL, adjustments ? adjustments : &tmp_adjustments)); 411 NULL, NULL, adjustments ? adjustments : &tmp_adjustments));
412 } 412 }
413 413
414 base::string16 CleanUpTitleForMatching(const base::string16& title) { 414 base::string16 CleanUpTitleForMatching(const base::string16& title) {
415 return base::i18n::ToLower(title.substr(0u, kCleanedUpTitleMaxLength)); 415 return base::i18n::ToLower(title.substr(0u, kCleanedUpTitleMaxLength));
416 } 416 }
417 417
418 bool HasManaged(BookmarkModel* model,
419 const std::vector<const BookmarkNode*>& list) {
420 for (size_t i = 0; i < list.size(); ++i) {
421 if (model->IsManaged(list[i]))
422 return true;
423 }
424 return false;
425 }
426
418 } // namespace bookmark_utils 427 } // namespace bookmark_utils
419 428
420 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) { 429 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) {
421 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate. 430 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate.
422 return GetNodeByID(model->root_node(), id); 431 return GetNodeByID(model->root_node(), id);
423 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698