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

Side by Side Diff: chrome/browser/extensions/install_verifier.cc

Issue 1125353002: Make extensions developer mode warning controllable by experiments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win compile problem with unreached code Created 5 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/extensions/install_verifier.h" 5 #include "chrome/browser/extensions/install_verifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 VerifyStatus GetStatus() { 104 VerifyStatus GetStatus() {
105 return std::max(GetExperimentStatus(), GetCommandLineStatus()); 105 return std::max(GetExperimentStatus(), GetCommandLineStatus());
106 } 106 }
107 107
108 bool ShouldFetchSignature() { 108 bool ShouldFetchSignature() {
109 return GetStatus() >= BOOTSTRAP; 109 return GetStatus() >= BOOTSTRAP;
110 } 110 }
111 111
112 bool ShouldEnforce() {
113 return GetStatus() >= ENFORCE;
114 }
115
116 enum InitResult { 112 enum InitResult {
117 INIT_NO_PREF = 0, 113 INIT_NO_PREF = 0,
118 INIT_UNPARSEABLE_PREF, 114 INIT_UNPARSEABLE_PREF,
119 INIT_INVALID_SIGNATURE, 115 INIT_INVALID_SIGNATURE,
120 INIT_VALID_SIGNATURE, 116 INIT_VALID_SIGNATURE,
121 117
122 // This is used in histograms - do not remove or reorder entries above! Also 118 // This is used in histograms - do not remove or reorder entries above! Also
123 // the "MAX" item below should always be the last element. 119 // the "MAX" item below should always be the last element.
124 120
125 INIT_RESULT_MAX 121 INIT_RESULT_MAX
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 content::BrowserContext* context) 173 content::BrowserContext* context)
178 : prefs_(prefs), 174 : prefs_(prefs),
179 context_(context), 175 context_(context),
180 bootstrap_check_complete_(false), 176 bootstrap_check_complete_(false),
181 weak_factory_(this) { 177 weak_factory_(this) {
182 } 178 }
183 179
184 InstallVerifier::~InstallVerifier() {} 180 InstallVerifier::~InstallVerifier() {}
185 181
186 // static 182 // static
183 bool InstallVerifier::ShouldEnforce() {
184 return GetStatus() >= ENFORCE;
185 }
186
187 // static
187 bool InstallVerifier::NeedsVerification(const Extension& extension) { 188 bool InstallVerifier::NeedsVerification(const Extension& extension) {
188 return IsFromStore(extension) && CanUseExtensionApis(extension); 189 return IsFromStore(extension) && CanUseExtensionApis(extension);
189 } 190 }
190 191
191 192
192 193
193 // static 194 // static
194 bool InstallVerifier::IsFromStore(const Extension& extension) { 195 bool InstallVerifier::IsFromStore(const Extension& extension) {
195 if (extension.from_webstore() || ManifestURL::UpdatesFromGallery(&extension)) 196 if (extension.from_webstore() || ManifestURL::UpdatesFromGallery(&extension))
196 return true; 197 return true;
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 633 }
633 634
634 OnVerificationComplete(success, operation->type); 635 OnVerificationComplete(success, operation->type);
635 } 636 }
636 637
637 if (!operation_queue_.empty()) 638 if (!operation_queue_.empty())
638 BeginFetch(); 639 BeginFetch();
639 } 640 }
640 641
641 } // namespace extensions 642 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_verifier.h ('k') | chrome/browser/ui/extensions/extension_message_bubble_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698