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

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

Issue 306143003: Remove the BookmarkService interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@371825.2
Patch Set: Rebase 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
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_model.h" 5 #include "components/bookmarks/browser/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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 base::AutoLock url_lock(url_lock_); 512 base::AutoLock url_lock(url_lock_);
513 return !nodes_ordered_by_url_set_.empty(); 513 return !nodes_ordered_by_url_set_.empty();
514 } 514 }
515 515
516 bool BookmarkModel::IsBookmarked(const GURL& url) { 516 bool BookmarkModel::IsBookmarked(const GURL& url) {
517 base::AutoLock url_lock(url_lock_); 517 base::AutoLock url_lock(url_lock_);
518 return IsBookmarkedNoLock(url); 518 return IsBookmarkedNoLock(url);
519 } 519 }
520 520
521 void BookmarkModel::GetBookmarks( 521 void BookmarkModel::GetBookmarks(
522 std::vector<BookmarkService::URLAndTitle>* bookmarks) { 522 std::vector<BookmarkModel::URLAndTitle>* bookmarks) {
523 base::AutoLock url_lock(url_lock_); 523 base::AutoLock url_lock(url_lock_);
524 const GURL* last_url = NULL; 524 const GURL* last_url = NULL;
525 for (NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.begin(); 525 for (NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.begin();
526 i != nodes_ordered_by_url_set_.end(); ++i) { 526 i != nodes_ordered_by_url_set_.end(); ++i) {
527 const GURL* url = &((*i)->url()); 527 const GURL* url = &((*i)->url());
528 // Only add unique URLs. 528 // Only add unique URLs.
529 if (!last_url || *url != *last_url) { 529 if (!last_url || *url != *last_url) {
530 BookmarkService::URLAndTitle bookmark; 530 BookmarkModel::URLAndTitle bookmark;
531 bookmark.url = *url; 531 bookmark.url = *url;
532 bookmark.title = (*i)->GetTitle(); 532 bookmark.title = (*i)->GetTitle();
533 bookmarks->push_back(bookmark); 533 bookmarks->push_back(bookmark);
534 } 534 }
535 last_url = url; 535 last_url = url;
536 } 536 }
537 } 537 }
538 538
539 void BookmarkModel::BlockTillLoaded() { 539 void BookmarkModel::BlockTillLoaded() {
540 loaded_signal_.Wait(); 540 loaded_signal_.Wait();
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 CreatePermanentNode(BookmarkNode::OTHER_NODE); 980 CreatePermanentNode(BookmarkNode::OTHER_NODE);
981 BookmarkPermanentNode* mobile_node = 981 BookmarkPermanentNode* mobile_node =
982 CreatePermanentNode(BookmarkNode::MOBILE); 982 CreatePermanentNode(BookmarkNode::MOBILE);
983 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails( 983 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails(
984 bb_node, 984 bb_node,
985 other_node, 985 other_node,
986 mobile_node, 986 mobile_node,
987 new BookmarkIndex(client_, index_urls_, accept_languages), 987 new BookmarkIndex(client_, index_urls_, accept_languages),
988 next_node_id_)); 988 next_node_id_));
989 } 989 }
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_model.h ('k') | components/bookmarks/browser/bookmark_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698