Add a webstorePrivate API to show a permission prompt for delegated bundle installs
[chromium-blink-merge.git] / chrome / browser / extensions / default_apps.h
blob01efa0dc43e836eff656f6671dae19b052e66112
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_
6 #define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_
8 #include "base/basictypes.h"
9 #include "chrome/browser/extensions/external_provider_impl.h"
10 #include "extensions/common/manifest.h"
12 class Profile;
14 namespace base {
15 class DictionaryValue;
18 namespace user_prefs {
19 class PrefRegistrySyncable;
22 // Functions and types related to installing default apps.
23 namespace default_apps {
25 // These enum values are persisted in the user preferences, so they should not
26 // be changed.
27 enum InstallState {
28 kUnknown,
29 // Now unused, left for backward compatibility.
30 kProvideLegacyDefaultApps,
31 kNeverInstallDefaultApps,
32 kAlreadyInstalledDefaultApps
35 // Register preference properties used by default apps to maintain
36 // install state.
37 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
39 // A specialization of the ExternalProviderImpl that conditionally installs apps
40 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the
41 // profile.
42 class Provider : public extensions::ExternalProviderImpl {
43 public:
44 Provider(Profile* profile,
45 VisitorInterface* service,
46 extensions::ExternalLoader* loader,
47 extensions::Manifest::Location crx_location,
48 extensions::Manifest::Location download_location,
49 int creation_flags);
51 bool ShouldInstallInProfile();
53 // ExternalProviderImpl overrides:
54 void VisitRegisteredExtension() override;
55 void SetPrefs(base::DictionaryValue* prefs) override;
57 private:
58 Profile* profile_;
59 bool is_migration_;
61 DISALLOW_COPY_AND_ASSIGN(Provider);
64 } // namespace default_apps
66 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_