| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // search sessions. | 40 // search sessions. |
| 41 class WebserviceCache : public KeyedService, | 41 class WebserviceCache : public KeyedService, |
| 42 public base::SupportsWeakPtr<WebserviceCache> { | 42 public base::SupportsWeakPtr<WebserviceCache> { |
| 43 public: | 43 public: |
| 44 enum QueryType { | 44 enum QueryType { |
| 45 WEBSTORE = 0, | 45 WEBSTORE = 0, |
| 46 PEOPLE = 1 | 46 PEOPLE = 1 |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 explicit WebserviceCache(content::BrowserContext* context); | 49 explicit WebserviceCache(content::BrowserContext* context); |
| 50 virtual ~WebserviceCache(); | 50 ~WebserviceCache() override; |
| 51 | 51 |
| 52 // Checks the current cache and returns the value for the |query| if it's | 52 // Checks the current cache and returns the value for the |query| if it's |
| 53 // valid. Otherwise an CacheResult object with the result field set to NULL. | 53 // valid. Otherwise an CacheResult object with the result field set to NULL. |
| 54 // A query consists of a query 'type' and the query itself. The two current | 54 // A query consists of a query 'type' and the query itself. The two current |
| 55 // types of queries supported are webstore queries and people search queries. | 55 // types of queries supported are webstore queries and people search queries. |
| 56 // The type silos the query into it's own separate domain, preventing any | 56 // The type silos the query into it's own separate domain, preventing any |
| 57 // mixing of the queries. | 57 // mixing of the queries. |
| 58 const CacheResult Get(QueryType type, const std::string& query); | 58 const CacheResult Get(QueryType type, const std::string& query); |
| 59 | 59 |
| 60 // Puts the new result to the query. | 60 // Puts the new result to the query. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 scoped_refptr<DictionaryDataStore> data_store_; | 104 scoped_refptr<DictionaryDataStore> data_store_; |
| 105 | 105 |
| 106 bool cache_loaded_; | 106 bool cache_loaded_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(WebserviceCache); | 108 DISALLOW_COPY_AND_ASSIGN(WebserviceCache); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace app_list | 111 } // namespace app_list |
| 112 | 112 |
| 113 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ | 113 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ |
| OLD | NEW |