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_SEARCH_SERVICE_H_ | 5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SEARCH_SERVICE_H_ |
6 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SEARCH_SERVICE_H_ | 6 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SEARCH_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // per query. | 32 // per query. |
33 void Search(const std::string& query); | 33 void Search(const std::string& query); |
34 | 34 |
35 // Returns the search results. The results are only available after the | 35 // Returns the search results. The results are only available after the |
36 // OnChange() observer methods has been sent. This method will return an empty | 36 // OnChange() observer methods has been sent. This method will return an empty |
37 // result otherwise. query should be a string passed to Search() previously. | 37 // result otherwise. query should be a string passed to Search() previously. |
38 std::vector<const BookmarkNode*> ResultForQuery(const std::string& query); | 38 std::vector<const BookmarkNode*> ResultForQuery(const std::string& query); |
39 | 39 |
40 protected: | 40 protected: |
41 | 41 |
42 virtual net::URLFetcher* CreateFetcher() OVERRIDE; | 42 virtual net::URLFetcher* CreateFetcher() override; |
43 | 43 |
44 virtual bool ProcessResponse(const std::string& response, | 44 virtual bool ProcessResponse(const std::string& response, |
45 bool* should_notify) OVERRIDE; | 45 bool* should_notify) override; |
46 | 46 |
47 virtual void CleanAfterFailure() OVERRIDE; | 47 virtual void CleanAfterFailure() override; |
48 | 48 |
49 // EnhancedBookmarkModelObserver methods. | 49 // EnhancedBookmarkModelObserver methods. |
50 virtual void EnhancedBookmarkModelLoaded() OVERRIDE{}; | 50 virtual void EnhancedBookmarkModelLoaded() override{}; |
51 virtual void EnhancedBookmarkAdded(const BookmarkNode* node) OVERRIDE; | 51 virtual void EnhancedBookmarkAdded(const BookmarkNode* node) override; |
52 virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) OVERRIDE{}; | 52 virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) override{}; |
53 virtual void EnhancedBookmarkAllUserNodesRemoved() OVERRIDE; | 53 virtual void EnhancedBookmarkAllUserNodesRemoved() override; |
54 virtual void EnhancedBookmarkRemoteIdChanged( | 54 virtual void EnhancedBookmarkRemoteIdChanged( |
55 const BookmarkNode* node, | 55 const BookmarkNode* node, |
56 const std::string& old_remote_id, | 56 const std::string& old_remote_id, |
57 const std::string& remote_id) OVERRIDE; | 57 const std::string& remote_id) override; |
58 | 58 |
59 private: | 59 private: |
60 // The search data, a map from query to a vector of stars.id. | 60 // The search data, a map from query to a vector of stars.id. |
61 std::map<std::string, std::vector<std::string> > searches_; | 61 std::map<std::string, std::vector<std::string> > searches_; |
62 std::string current_query_; | 62 std::string current_query_; |
63 DISALLOW_COPY_AND_ASSIGN(BookmarkServerSearchService); | 63 DISALLOW_COPY_AND_ASSIGN(BookmarkServerSearchService); |
64 }; | 64 }; |
65 } // namespace enhanced_bookmarks | 65 } // namespace enhanced_bookmarks |
66 | 66 |
67 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SEARCH_SERVICE_H_ | 67 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_SEARCH_SERVICE_H_ |
OLD | NEW |