| 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_EXTENSIONS_DEFAULT_APPS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/extensions/external_provider_impl.h" | 9 #include "chrome/browser/extensions/external_provider_impl.h" |
| 10 | 10 |
| 11 class PrefService; | 11 class PrefService; |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 class Extension; | 15 class Extension; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace base { |
| 19 class DictionaryValue; |
| 20 } |
| 21 |
| 18 // Functions and types related to installing default apps. | 22 // Functions and types related to installing default apps. |
| 19 namespace default_apps { | 23 namespace default_apps { |
| 20 | 24 |
| 21 // These enum values are persisted in the user preferences, so they should not | 25 // These enum values are persisted in the user preferences, so they should not |
| 22 // be changed. | 26 // be changed. |
| 23 enum InstallState { | 27 enum InstallState { |
| 24 kUnknown, | 28 kUnknown, |
| 25 // Now unused, left for backward compatibility. | 29 // Now unused, left for backward compatibility. |
| 26 kProvideLegacyDefaultApps, | 30 kProvideLegacyDefaultApps, |
| 27 kNeverInstallDefaultApps, | 31 kNeverInstallDefaultApps, |
| 28 kAlreadyInstalledDefaultApps | 32 kAlreadyInstalledDefaultApps |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 bool ShouldInstallInProfile(Profile* profile); | |
| 32 | |
| 33 bool isLocaleSupported(); | |
| 34 | |
| 35 // Register preference properties used by default apps to maintain | 35 // Register preference properties used by default apps to maintain |
| 36 // install state. | 36 // install state. |
| 37 void RegisterUserPrefs(PrefService* prefs); | 37 void RegisterUserPrefs(PrefService* prefs); |
| 38 | 38 |
| 39 // A specialization of the ExternalProviderImpl that conditionally installs apps | 39 // A specialization of the ExternalProviderImpl that conditionally installs apps |
| 40 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the | 40 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the |
| 41 // profile. | 41 // profile. |
| 42 class Provider : public extensions::ExternalProviderImpl { | 42 class Provider : public extensions::ExternalProviderImpl { |
| 43 public: | 43 public: |
| 44 Provider(Profile* profile, | 44 Provider(Profile* profile, |
| 45 VisitorInterface* service, | 45 VisitorInterface* service, |
| 46 extensions::ExternalLoader* loader, | 46 extensions::ExternalLoader* loader, |
| 47 extensions::Extension::Location crx_location, | 47 extensions::Extension::Location crx_location, |
| 48 extensions::Extension::Location download_location, | 48 extensions::Extension::Location download_location, |
| 49 int creation_flags); | 49 int creation_flags); |
| 50 | 50 |
| 51 // ExternalProviderImpl overrides: | 51 // ExternalProviderImpl overrides: |
| 52 virtual void VisitRegisteredExtension() OVERRIDE; | 52 virtual void VisitRegisteredExtension() OVERRIDE; |
| 53 virtual void SetPrefs(base::DictionaryValue* prefs) OVERRIDE; |
| 53 | 54 |
| 54 private: | 55 private: |
| 56 bool ShouldInstallInProfile(); |
| 57 |
| 55 Profile* profile_; | 58 Profile* profile_; |
| 59 bool isMigration_; |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(Provider); | 61 DISALLOW_COPY_AND_ASSIGN(Provider); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 } // namespace default_apps | 64 } // namespace default_apps |
| 61 | 65 |
| 62 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 66 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| OLD | NEW |