| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INTENTS_WEB_INTENTS_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_INTENTS_WEB_INTENTS_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_INTENTS_WEB_INTENTS_REGISTRY_H_ | 6 #define CHROME_BROWSER_INTENTS_WEB_INTENTS_REGISTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual ~WebIntentsRegistry(); | 78 virtual ~WebIntentsRegistry(); |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 struct IntentsQuery; | 81 struct IntentsQuery; |
| 82 | 82 |
| 83 // Maps web data requests to intents queries. | 83 // Maps web data requests to intents queries. |
| 84 // Allows OnWebDataServiceRequestDone to forward to appropriate consumer. | 84 // Allows OnWebDataServiceRequestDone to forward to appropriate consumer. |
| 85 typedef base::hash_map<WebDataService::Handle, IntentsQuery*> QueryMap; | 85 typedef base::hash_map<WebDataService::Handle, IntentsQuery*> QueryMap; |
| 86 | 86 |
| 87 // WebDataServiceConsumer implementation. | 87 // WebDataServiceConsumer implementation. |
| 88 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 88 virtual void OnWebDataServiceRequestDone( |
| 89 const WDTypedResult* result); | 89 WebDataService::Handle h, |
| 90 const WDTypedResult* result) OVERRIDE; |
| 90 | 91 |
| 91 // Map for all in-flight web data requests/intent queries. | 92 // Map for all in-flight web data requests/intent queries. |
| 92 QueryMap queries_; | 93 QueryMap queries_; |
| 93 | 94 |
| 94 // Unique identifier for next intent query. | 95 // Unique identifier for next intent query. |
| 95 QueryID next_query_id_; | 96 QueryID next_query_id_; |
| 96 | 97 |
| 97 // Local reference to Web Data Service. | 98 // Local reference to Web Data Service. |
| 98 scoped_refptr<WebDataService> wds_; | 99 scoped_refptr<WebDataService> wds_; |
| 99 | 100 |
| 100 // Local reference to the ExtensionService. | 101 // Local reference to the ExtensionService. |
| 101 // Shutdown/cleanup is handled by ProfileImpl. We are guaranteed that any | 102 // Shutdown/cleanup is handled by ProfileImpl. We are guaranteed that any |
| 102 // ProfileKeyedService will be shut down before data on ProfileImpl is | 103 // ProfileKeyedService will be shut down before data on ProfileImpl is |
| 103 // destroyed (i.e. |extension_service_|), so |extension_service_| is valid | 104 // destroyed (i.e. |extension_service_|), so |extension_service_| is valid |
| 104 // for the lifetime of the WebIntentsRegistry object. | 105 // for the lifetime of the WebIntentsRegistry object. |
| 105 ExtensionServiceInterface* extension_service_; | 106 ExtensionServiceInterface* extension_service_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(WebIntentsRegistry); | 108 DISALLOW_COPY_AND_ASSIGN(WebIntentsRegistry); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 #endif // CHROME_BROWSER_INTENTS_WEB_INTENTS_REGISTRY_H_ | 111 #endif // CHROME_BROWSER_INTENTS_WEB_INTENTS_REGISTRY_H_ |
| OLD | NEW |