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

Side by Side Diff: components/enhanced_bookmarks/bookmark_server_service.cc

Issue 637323005: Add Search Service in Enhanced Bookmark Bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments Created 6 years, 1 month 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/enhanced_bookmarks/bookmark_server_service.h" 5 #include "components/enhanced_bookmarks/bookmark_server_service.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" 8 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h"
9 #include "components/signin/core/browser/profile_oauth2_token_service.h" 9 #include "components/signin/core/browser/profile_oauth2_token_service.h"
10 #include "components/signin/core/browser/signin_manager_base.h" 10 #include "components/signin/core/browser/signin_manager_base.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const BookmarkNode* BookmarkServerService::BookmarkForRemoteId( 49 const BookmarkNode* BookmarkServerService::BookmarkForRemoteId(
50 const std::string& remote_id) const { 50 const std::string& remote_id) const {
51 return model_->BookmarkForRemoteId(remote_id); 51 return model_->BookmarkForRemoteId(remote_id);
52 } 52 }
53 53
54 const std::string BookmarkServerService::RemoteIDForBookmark( 54 const std::string BookmarkServerService::RemoteIDForBookmark(
55 const BookmarkNode* bookmark) const { 55 const BookmarkNode* bookmark) const {
56 return model_->GetRemoteId(bookmark); 56 return model_->GetRemoteId(bookmark);
57 } 57 }
58 58
59 void BookmarkServerService::Cancel() {
60 url_fetcher_.reset();
61 token_request_.reset();
62 }
63
59 void BookmarkServerService::Notify() { 64 void BookmarkServerService::Notify() {
60 FOR_EACH_OBSERVER(BookmarkServerServiceObserver, observers_, OnChange(this)); 65 FOR_EACH_OBSERVER(BookmarkServerServiceObserver, observers_, OnChange(this));
61 } 66 }
62 67
63 void BookmarkServerService::TriggerTokenRequest(bool cancel_previous) { 68 void BookmarkServerService::TriggerTokenRequest(bool cancel_previous) {
64 if (cancel_previous) 69 if (cancel_previous)
65 url_fetcher_.reset(); 70 url_fetcher_.reset();
66 71
67 if (token_request_ || url_fetcher_) 72 if (token_request_ || url_fetcher_)
68 return; // Fetcher is already running. 73 return; // Fetcher is already running.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void BookmarkServerService::EnhancedBookmarkModelShuttingDown() { 148 void BookmarkServerService::EnhancedBookmarkModelShuttingDown() {
144 NOTREACHED(); 149 NOTREACHED();
145 } 150 }
146 151
147 SigninManagerBase* BookmarkServerService::GetSigninManager() { 152 SigninManagerBase* BookmarkServerService::GetSigninManager() {
148 DCHECK(signin_manager_); 153 DCHECK(signin_manager_);
149 return signin_manager_; 154 return signin_manager_;
150 } 155 }
151 156
152 } // namespace enhanced_bookmarks 157 } // namespace enhanced_bookmarks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698