blob: d98f43cd280b85301dee347d2483f8173fe56fd8 [file] [log] [blame]
[email protected]5df038b2012-07-16 19:03:271// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]86c6b9e32011-10-25 17:09:102// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_
6#define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_
[email protected]86c6b9e32011-10-25 17:09:107
avia2f4804a2015-12-24 23:11:138#include "base/macros.h"
Matthew Dentonef83a622019-08-30 02:07:009#include "base/memory/scoped_refptr.h"
[email protected]5df038b2012-07-16 19:03:2710#include "chrome/browser/extensions/external_provider_impl.h"
[email protected]d42c11152013-08-22 19:36:3211#include "extensions/common/manifest.h"
[email protected]86c6b9e32011-10-25 17:09:1012
[email protected]86c6b9e32011-10-25 17:09:1013class Profile;
14
[email protected]937cf9d2012-08-30 03:51:5515namespace base {
16class DictionaryValue;
17}
18
[email protected]443e9312013-05-06 06:17:3419namespace user_prefs {
20class PrefRegistrySyncable;
21}
22
[email protected]86c6b9e32011-10-25 17:09:1023// Functions and types related to installing default apps.
24namespace default_apps {
25
26// These enum values are persisted in the user preferences, so they should not
27// be changed.
28enum InstallState {
29 kUnknown,
[email protected]910f72ce2012-08-24 01:38:3530 // Now unused, left for backward compatibility.
31 kProvideLegacyDefaultApps,
32 kNeverInstallDefaultApps,
33 kAlreadyInstalledDefaultApps
[email protected]86c6b9e32011-10-25 17:09:1034};
35
36// Register preference properties used by default apps to maintain
37// install state.
[email protected]37ca3fe02013-07-05 15:32:4438void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
[email protected]86c6b9e32011-10-25 17:09:1039
[email protected]5df038b2012-07-16 19:03:2740// A specialization of the ExternalProviderImpl that conditionally installs apps
41// from the chrome::DIR_DEFAULT_APPS location based on a preference in the
42// profile.
43class Provider : public extensions::ExternalProviderImpl {
[email protected]d190cef2011-11-09 02:09:2444 public:
45 Provider(Profile* profile,
46 VisitorInterface* service,
Matthew Dentonef83a622019-08-30 02:07:0047 scoped_refptr<extensions::ExternalLoader> loader,
[email protected]1d5e58b2013-01-31 08:41:4048 extensions::Manifest::Location crx_location,
49 extensions::Manifest::Location download_location,
[email protected]d190cef2011-11-09 02:09:2450 int creation_flags);
51
[email protected]937cf9d2012-08-30 03:51:5552 bool ShouldInstallInProfile();
53
[email protected]5df038b2012-07-16 19:03:2754 // ExternalProviderImpl overrides:
dchengae36a4a2014-10-21 12:36:3655 void VisitRegisteredExtension() override;
Istiaque Ahmeda7431b32017-08-20 18:33:3756 void SetPrefs(std::unique_ptr<base::DictionaryValue> prefs) override;
[email protected]d190cef2011-11-09 02:09:2457
58 private:
59 Profile* profile_;
[email protected]937cf9d2012-08-30 03:51:5560 bool is_migration_;
[email protected]d190cef2011-11-09 02:09:2461
62 DISALLOW_COPY_AND_ASSIGN(Provider);
63};
64
[email protected]86c6b9e32011-10-25 17:09:1065} // namespace default_apps
66
67#endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_