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