OLD | NEW |
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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/trace_event/trace_event.h" |
16 #include "chrome/browser/extensions/extension_management.h" | 17 #include "chrome/browser/extensions/extension_management.h" |
17 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
18 #include "chrome/browser/extensions/install_signer.h" | 19 #include "chrome/browser/extensions/install_signer.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
21 #include "content/public/browser/browser_context.h" | 22 #include "content/public/browser/browser_context.h" |
22 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
23 #include "extensions/browser/extension_prefs.h" | 24 #include "extensions/browser/extension_prefs.h" |
24 #include "extensions/browser/extension_registry.h" | 25 #include "extensions/browser/extension_registry.h" |
25 #include "extensions/browser/extension_system.h" | 26 #include "extensions/browser/extension_system.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // If an extension has no update url, our autoupdate code will ask the | 198 // If an extension has no update url, our autoupdate code will ask the |
198 // webstore about it (to aid in migrating to the webstore from self-hosting | 199 // webstore about it (to aid in migrating to the webstore from self-hosting |
199 // or sideloading based installs). So we want to do verification checks on | 200 // or sideloading based installs). So we want to do verification checks on |
200 // such extensions too so that we don't accidentally disable old installs of | 201 // such extensions too so that we don't accidentally disable old installs of |
201 // extensions that did migrate to the webstore. | 202 // extensions that did migrate to the webstore. |
202 return (ManifestURL::GetUpdateURL(&extension).is_empty() && | 203 return (ManifestURL::GetUpdateURL(&extension).is_empty() && |
203 Manifest::IsAutoUpdateableLocation(extension.location())); | 204 Manifest::IsAutoUpdateableLocation(extension.location())); |
204 } | 205 } |
205 | 206 |
206 void InstallVerifier::Init() { | 207 void InstallVerifier::Init() { |
| 208 TRACE_EVENT0("browser,startup", "extensions::InstallVerifier::Init"); |
207 UMA_HISTOGRAM_ENUMERATION("ExtensionInstallVerifier.ExperimentStatus", | 209 UMA_HISTOGRAM_ENUMERATION("ExtensionInstallVerifier.ExperimentStatus", |
208 GetExperimentStatus(), VERIFY_STATUS_MAX); | 210 GetExperimentStatus(), VERIFY_STATUS_MAX); |
209 UMA_HISTOGRAM_ENUMERATION("ExtensionInstallVerifier.ActualStatus", | 211 UMA_HISTOGRAM_ENUMERATION("ExtensionInstallVerifier.ActualStatus", |
210 GetStatus(), VERIFY_STATUS_MAX); | 212 GetStatus(), VERIFY_STATUS_MAX); |
211 | 213 |
212 const base::DictionaryValue* pref = prefs_->GetInstallSignature(); | 214 const base::DictionaryValue* pref = prefs_->GetInstallSignature(); |
213 if (pref) { | 215 if (pref) { |
214 scoped_ptr<InstallSignature> signature_from_prefs = | 216 scoped_ptr<InstallSignature> signature_from_prefs = |
215 InstallSignature::FromValue(*pref); | 217 InstallSignature::FromValue(*pref); |
216 if (!signature_from_prefs.get()) { | 218 if (!signature_from_prefs.get()) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 632 } |
631 | 633 |
632 OnVerificationComplete(success, operation->type); | 634 OnVerificationComplete(success, operation->type); |
633 } | 635 } |
634 | 636 |
635 if (!operation_queue_.empty()) | 637 if (!operation_queue_.empty()) |
636 BeginFetch(); | 638 BeginFetch(); |
637 } | 639 } |
638 | 640 |
639 } // namespace extensions | 641 } // namespace extensions |
OLD | NEW |