| 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_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_extension_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 // Functions and types related to installing default apps. | 18 // Functions and types related to installing default apps. |
| 19 namespace default_apps { | 19 namespace default_apps { |
| 20 | 20 |
| 21 // These enum values are persisted in the user preferences, so they should not | 21 // These enum values are persisted in the user preferences, so they should not |
| 22 // be changed. | 22 // be changed. |
| 23 enum InstallState { | 23 enum InstallState { |
| 24 kUnknown, | 24 kUnknown, |
| 25 kAlwaysProvideDefaultApps, | 25 kAlwaysProvideDefaultApps, |
| 26 kNeverProvideDefaultApps | 26 kNeverProvideDefaultApps |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Register preference properties used by default apps to maintain | 29 // Register preference properties used by default apps to maintain |
| 30 // install state. | 30 // install state. |
| 31 void RegisterUserPrefs(PrefService* prefs); | 31 void RegisterUserPrefs(PrefService* prefs); |
| 32 | 32 |
| 33 | 33 |
| 34 // A specialization of the ExternalExtensionProviderImpl that conditionally | 34 // A specialization of the ExternalProviderImpl that conditionally installs apps |
| 35 // installs apps from the chrome::DIR_DEFAULT_APPS location based on a | 35 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the |
| 36 // preference in the profile. | 36 // profile. |
| 37 class Provider : public ExternalExtensionProviderImpl { | 37 class Provider : public extensions::ExternalProviderImpl { |
| 38 public: | 38 public: |
| 39 Provider(Profile* profile, | 39 Provider(Profile* profile, |
| 40 VisitorInterface* service, | 40 VisitorInterface* service, |
| 41 ExternalExtensionLoader* loader, | 41 extensions::ExternalLoader* loader, |
| 42 extensions::Extension::Location crx_location, | 42 extensions::Extension::Location crx_location, |
| 43 extensions::Extension::Location download_location, | 43 extensions::Extension::Location download_location, |
| 44 int creation_flags); | 44 int creation_flags); |
| 45 | 45 |
| 46 // ExternalExtensionProviderImpl overrides: | 46 // ExternalProviderImpl overrides: |
| 47 virtual void VisitRegisteredExtension() OVERRIDE; | 47 virtual void VisitRegisteredExtension() OVERRIDE; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 Profile* profile_; | 50 Profile* profile_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(Provider); | 52 DISALLOW_COPY_AND_ASSIGN(Provider); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 | |
| 56 } // namespace default_apps | 55 } // namespace default_apps |
| 57 | 56 |
| 58 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| OLD | NEW |