Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/browser/extensions/default_apps.h

Issue 10875065: Disable install of new default_apps for existing users (Closed) Base URL: http://git.chromium.org/git/chromium.git@disable_sync_behav
Patch Set: Moved the migration to Provider class Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/default_apps.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
25 bool isLocaleSupported();
26
27 // Returns true if the app was a default app in Chrome 22
28 bool isOldDefaultApp(const std::string& extension_id);
Gaurav 2012/08/28 00:58:36 I tried removing it and putting it in anonymous na
29
30
21 // These enum values are persisted in the user preferences, so they should not 31 // These enum values are persisted in the user preferences, so they should not
22 // be changed. 32 // be changed.
23 enum InstallState { 33 enum InstallState {
24 kUnknown, 34 kUnknown,
25 // Now unused, left for backward compatibility. 35 // Now unused, left for backward compatibility.
26 kProvideLegacyDefaultApps, 36 kProvideLegacyDefaultApps,
27 kNeverInstallDefaultApps, 37 kNeverInstallDefaultApps,
28 kAlreadyInstalledDefaultApps 38 kAlreadyInstalledDefaultApps
29 }; 39 };
30 40
31 bool ShouldInstallInProfile(Profile* profile);
32
33 bool isLocaleSupported();
34
35 // Register preference properties used by default apps to maintain 41 // Register preference properties used by default apps to maintain
36 // install state. 42 // install state.
37 void RegisterUserPrefs(PrefService* prefs); 43 void RegisterUserPrefs(PrefService* prefs);
38 44
39 // A specialization of the ExternalProviderImpl that conditionally installs apps 45 // A specialization of the ExternalProviderImpl that conditionally installs apps
40 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the 46 // from the chrome::DIR_DEFAULT_APPS location based on a preference in the
41 // profile. 47 // profile.
42 class Provider : public extensions::ExternalProviderImpl { 48 class Provider : public extensions::ExternalProviderImpl {
43 public: 49 public:
44 Provider(Profile* profile, 50 Provider(Profile* profile,
45 VisitorInterface* service, 51 VisitorInterface* service,
46 extensions::ExternalLoader* loader, 52 extensions::ExternalLoader* loader,
47 extensions::Extension::Location crx_location, 53 extensions::Extension::Location crx_location,
48 extensions::Extension::Location download_location, 54 extensions::Extension::Location download_location,
49 int creation_flags); 55 int creation_flags);
50 56
51 // ExternalProviderImpl overrides: 57 // ExternalProviderImpl overrides:
52 virtual void VisitRegisteredExtension() OVERRIDE; 58 virtual void VisitRegisteredExtension() OVERRIDE;
59 virtual void SetPrefs(base::DictionaryValue* prefs) OVERRIDE;
53 60
54 private: 61 private:
62 bool ShouldInstallInProfile();
63
55 Profile* profile_; 64 Profile* profile_;
65 bool isMigration_;
56 66
57 DISALLOW_COPY_AND_ASSIGN(Provider); 67 DISALLOW_COPY_AND_ASSIGN(Provider);
58 }; 68 };
59 69
60 } // namespace default_apps 70 } // namespace default_apps
61 71
62 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ 72 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/default_apps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698