| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // Returns default wallpaper URL. | 162 // Returns default wallpaper URL. |
| 163 GURL GetDefaultWallpaperUrl() const; | 163 GURL GetDefaultWallpaperUrl() const; |
| 164 | 164 |
| 165 // Returns list of default apps. | 165 // Returns list of default apps. |
| 166 bool GetDefaultApps(std::vector<std::string>* ids) const; | 166 bool GetDefaultApps(std::vector<std::string>* ids) const; |
| 167 | 167 |
| 168 // Creates an extensions::ExternalLoader that will provide OEM default apps. | 168 // Creates an extensions::ExternalLoader that will provide OEM default apps. |
| 169 // Cache of OEM default apps stored in profile preferences. | 169 // Cache of OEM default apps stored in profile preferences. |
| 170 extensions::ExternalLoader* CreateExternalLoader(Profile* profile); | 170 extensions::ExternalLoader* CreateExternalLoader(Profile* profile); |
| 171 | 171 |
| 172 // Returns the name of the folder for OEM apps for given |locale|. |
| 173 std::string GetOemAppsFolderName(const std::string& locale) const; |
| 174 |
| 172 // Set delay between network checking for testing. | 175 // Set delay between network checking for testing. |
| 173 void SetZeroNetworkDelayForTesting() { | 176 void SetZeroNetworkDelayForTesting() { |
| 174 network_delay_ = base::TimeDelta(); | 177 network_delay_ = base::TimeDelta(); |
| 175 } | 178 } |
| 176 | 179 |
| 177 private: | 180 private: |
| 178 friend struct DefaultSingletonTraits<ServicesCustomizationDocument>; | 181 friend struct DefaultSingletonTraits<ServicesCustomizationDocument>; |
| 179 | 182 |
| 180 typedef std::vector<base::WeakPtr<ServicesCustomizationExternalLoader> > | 183 typedef std::vector<base::WeakPtr<ServicesCustomizationExternalLoader> > |
| 181 ExternalLoaders; | 184 ExternalLoaders; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // Returns list of default apps in ExternalProvider format. | 220 // Returns list of default apps in ExternalProvider format. |
| 218 static scoped_ptr<base::DictionaryValue> GetDefaultAppsInProviderFormat( | 221 static scoped_ptr<base::DictionaryValue> GetDefaultAppsInProviderFormat( |
| 219 const base::DictionaryValue& root); | 222 const base::DictionaryValue& root); |
| 220 | 223 |
| 221 // Update cached manifest for |profile|. | 224 // Update cached manifest for |profile|. |
| 222 void UpdateCachedManifest(Profile* profile); | 225 void UpdateCachedManifest(Profile* profile); |
| 223 | 226 |
| 224 // Customization document not found for give ID. | 227 // Customization document not found for give ID. |
| 225 void OnCustomizationNotFound(); | 228 void OnCustomizationNotFound(); |
| 226 | 229 |
| 230 // Set OEM apps folder name for AppListSyncableService for |profile|. |
| 231 void SetOemFolderName(Profile* profile, const base::DictionaryValue& root); |
| 232 |
| 233 // Returns the name of the folder for OEM apps for given |locale|. |
| 234 std::string GetOemAppsFolderNameImpl( |
| 235 const std::string& locale, |
| 236 const base::DictionaryValue& root) const; |
| 237 |
| 227 // Services customization manifest URL. | 238 // Services customization manifest URL. |
| 228 GURL url_; | 239 GURL url_; |
| 229 | 240 |
| 230 // URLFetcher instance. | 241 // URLFetcher instance. |
| 231 scoped_ptr<net::URLFetcher> url_fetcher_; | 242 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 232 | 243 |
| 233 // How many times we already tried to fetch customization manifest file. | 244 // How many times we already tried to fetch customization manifest file. |
| 234 int num_retries_; | 245 int num_retries_; |
| 235 | 246 |
| 236 // Manifest fetch is already in progress. | 247 // Manifest fetch is already in progress. |
| 237 bool fetch_started_; | 248 bool fetch_started_; |
| 238 | 249 |
| 239 // Delay between checks for network online state. | 250 // Delay between checks for network online state. |
| 240 base::TimeDelta network_delay_; | 251 base::TimeDelta network_delay_; |
| 241 | 252 |
| 242 // Known external loaders. | 253 // Known external loaders. |
| 243 ExternalLoaders external_loaders_; | 254 ExternalLoaders external_loaders_; |
| 244 | 255 |
| 245 // Weak factory for callbacks. | 256 // Weak factory for callbacks. |
| 246 base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_; | 257 base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_; |
| 247 | 258 |
| 248 DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); | 259 DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); |
| 249 }; | 260 }; |
| 250 | 261 |
| 251 } // namespace chromeos | 262 } // namespace chromeos |
| 252 | 263 |
| 253 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ | 264 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_DOCUMENT_H_ |
| OLD | NEW |