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

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

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing the build Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PENDING_EXTENSION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // if the extension is pending from another source which overrides 73 // if the extension is pending from another source which overrides
74 // sync installs (such as a policy extension) or if the extension 74 // sync installs (such as a policy extension) or if the extension
75 // is already installed. 75 // is already installed.
76 // After installation, the extension will be granted permissions iff 76 // After installation, the extension will be granted permissions iff
77 // |version| is valid and matches the actual installed version. 77 // |version| is valid and matches the actual installed version.
78 bool AddFromSync( 78 bool AddFromSync(
79 const std::string& id, 79 const std::string& id,
80 const GURL& update_url, 80 const GURL& update_url,
81 const base::Version& version, 81 const base::Version& version,
82 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, 82 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install,
83 bool remote_install, 83 bool remote_install);
84 bool installed_by_custodian);
85 84
86 // Adds an extension that was depended on by another extension. 85 // Adds an extension that was depended on by another extension.
87 bool AddFromExtensionImport( 86 bool AddFromExtensionImport(
88 const std::string& id, 87 const std::string& id,
89 const GURL& update_url, 88 const GURL& update_url,
90 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install); 89 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install);
91 90
92 // Given an extension id and an update URL, schedule the extension 91 // Given an extension id and an update URL, schedule the extension
93 // to be fetched, installed, and activated. 92 // to be fetched, installed, and activated.
94 bool AddFromExternalUpdateUrl(const std::string& id, 93 bool AddFromExternalUpdateUrl(const std::string& id,
(...skipping 25 matching lines...) Expand all
120 // Assumes an extension with id |id| is not already installed. 119 // Assumes an extension with id |id| is not already installed.
121 // Return true if the extension was added. 120 // Return true if the extension was added.
122 bool AddExtensionImpl( 121 bool AddExtensionImpl(
123 const std::string& id, 122 const std::string& id,
124 const std::string& install_parameter, 123 const std::string& install_parameter,
125 const GURL& update_url, 124 const GURL& update_url,
126 const base::Version& version, 125 const base::Version& version,
127 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, 126 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install,
128 bool is_from_sync, 127 bool is_from_sync,
129 Manifest::Location install_source, 128 Manifest::Location install_source,
130 int creation_flags,
131 bool mark_acknowledged, 129 bool mark_acknowledged,
132 bool remote_install); 130 bool remote_install);
133 131
134 // Add a pending extension record directly. Used for unit tests that need 132 // Add a pending extension record directly. Used for unit tests that need
135 // to set an inital state. Use friendship to allow the tests to call this 133 // to set an inital state. Use friendship to allow the tests to call this
136 // method. 134 // method.
137 void AddForTesting(const PendingExtensionInfo& pending_extension_info); 135 void AddForTesting(const PendingExtensionInfo& pending_extension_info);
138 136
139 // The BrowserContext with which the manager is associated. 137 // The BrowserContext with which the manager is associated.
140 content::BrowserContext* context_; 138 content::BrowserContext* context_;
141 139
142 PendingExtensionList pending_extension_list_; 140 PendingExtensionList pending_extension_list_;
143 141
144 FRIEND_TEST_ALL_PREFIXES(::ExtensionServiceTest, 142 FRIEND_TEST_ALL_PREFIXES(::ExtensionServiceTest,
145 UpdatePendingExtensionAlreadyInstalled); 143 UpdatePendingExtensionAlreadyInstalled);
146 friend class ExtensionUpdaterTest; 144 friend class ExtensionUpdaterTest;
147 friend void SetupPendingExtensionManagerForTest( 145 friend void SetupPendingExtensionManagerForTest(
148 int count, const GURL& update_url, 146 int count, const GURL& update_url,
149 PendingExtensionManager* pending_extension_manager); 147 PendingExtensionManager* pending_extension_manager);
150 148
151 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager); 149 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager);
152 }; 150 };
153 151
154 } // namespace extensions 152 } // namespace extensions
155 153
156 #endif // CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_ 154 #endif // CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/pending_extension_info.cc ('k') | chrome/browser/extensions/pending_extension_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698