| OLD | NEW |
| 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 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ | 5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ |
| 6 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ | 6 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual void AddObserver(BookmarkServerServiceObserver* observer); | 50 virtual void AddObserver(BookmarkServerServiceObserver* observer); |
| 51 void RemoveObserver(BookmarkServerServiceObserver* observer); | 51 void RemoveObserver(BookmarkServerServiceObserver* observer); |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 // Retrieves a bookmark by using its remote id. Returns null if nothing | 54 // Retrieves a bookmark by using its remote id. Returns null if nothing |
| 55 // matches. | 55 // matches. |
| 56 virtual const BookmarkNode* BookmarkForRemoteId( | 56 virtual const BookmarkNode* BookmarkForRemoteId( |
| 57 const std::string& remote_id) const; | 57 const std::string& remote_id) const; |
| 58 const std::string RemoteIDForBookmark(const BookmarkNode* bookmark) const; | 58 const std::string RemoteIDForBookmark(const BookmarkNode* bookmark) const; |
| 59 | 59 |
| 60 // Cancels the ongoing request, if any. | |
| 61 void Cancel(); | |
| 62 | |
| 63 // Notifies the observers that something changed. | 60 // Notifies the observers that something changed. |
| 64 void Notify(); | 61 void Notify(); |
| 65 | 62 |
| 66 // Triggers a fetch. | 63 // Triggers a fetch. |
| 67 void TriggerTokenRequest(bool cancel_previous); | 64 void TriggerTokenRequest(bool cancel_previous); |
| 68 | 65 |
| 69 // Build the query to send to the server. Returns a newly created url_fetcher. | 66 // Build the query to send to the server. Returns a newly created url_fetcher. |
| 70 virtual scoped_ptr<net::URLFetcher> CreateFetcher() = 0; | 67 virtual scoped_ptr<net::URLFetcher> CreateFetcher() = 0; |
| 71 | 68 |
| 72 // Processes the response to the query. Returns true on successful parsing, | 69 // Processes the response to the query. Returns true on successful parsing, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // To have access to the right context getter for the profile. | 113 // To have access to the right context getter for the profile. |
| 117 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 114 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 118 // The fetcher used to query the server. | 115 // The fetcher used to query the server. |
| 119 scoped_ptr<net::URLFetcher> url_fetcher_; | 116 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 120 | 117 |
| 121 DISALLOW_COPY_AND_ASSIGN(BookmarkServerService); | 118 DISALLOW_COPY_AND_ASSIGN(BookmarkServerService); |
| 122 }; | 119 }; |
| 123 } // namespace enhanced_bookmarks | 120 } // namespace enhanced_bookmarks |
| 124 | 121 |
| 125 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ | 122 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SERVICE_H_ |
| OLD | NEW |