OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
6 #define CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/utility_process_host.h" | 10 #include "chrome/browser/utility_process_host.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 ~WebResourceService(); | 21 ~WebResourceService(); |
22 | 22 |
23 // Sleep until cache needs to be updated, but always for at least 5 seconds | 23 // Sleep until cache needs to be updated, but always for at least 5 seconds |
24 // so we don't interfere with startup. Then begin updating resources. | 24 // so we don't interfere with startup. Then begin updating resources. |
25 void StartAfterDelay(); | 25 void StartAfterDelay(); |
26 | 26 |
27 // We have successfully pulled data from a resource server; now launch | 27 // We have successfully pulled data from a resource server; now launch |
28 // the process that will parse the JSON, and then update the cache. | 28 // the process that will parse the JSON, and then update the cache. |
29 void UpdateResourceCache(const std::string& json_data); | 29 void UpdateResourceCache(const std::string& json_data); |
30 | 30 |
| 31 // Get the language appropriate for delivery of the web resources. |
| 32 static std::wstring GetWebResourceLanguage(PrefService* prefs); |
| 33 |
31 static const wchar_t* kTipDictionaryPrefName; | 34 static const wchar_t* kTipDictionaryPrefName; |
32 static const wchar_t* kCurrentTipPrefName; | 35 static const wchar_t* kCurrentTipPrefName; |
33 static const wchar_t* kTipCachePrefName; | 36 static const wchar_t* kTipCachePrefName; |
34 | 37 |
35 // Default server from which to gather resources. | 38 // Default server from which to gather resources. |
36 static const wchar_t* kDefaultResourceServer; | 39 static const wchar_t* kDefaultResourceServer; |
37 | 40 |
38 private: | 41 private: |
39 class WebResourceFetcher; | 42 class WebResourceFetcher; |
40 friend class WebResourceFetcher; | 43 friend class WebResourceFetcher; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 88 |
86 // Name of directory inside the profile where we will store resource-related | 89 // Name of directory inside the profile where we will store resource-related |
87 // data (for now, thumbnail images). | 90 // data (for now, thumbnail images). |
88 static const char* kResourceDirectoryName; | 91 static const char* kResourceDirectoryName; |
89 | 92 |
90 DISALLOW_COPY_AND_ASSIGN(WebResourceService); | 93 DISALLOW_COPY_AND_ASSIGN(WebResourceService); |
91 }; | 94 }; |
92 | 95 |
93 #endif // CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ | 96 #endif // CHROME_BROWSER_WEB_RESOURCE_WEB_RESOURCE_SERVICE_H_ |
94 | 97 |
OLD | NEW |