| OLD | NEW |
| 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 #include "chrome/browser/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if (extension->is_theme() || Manifest::IsExternalLocation(install_source_)) | 323 if (extension->is_theme() || Manifest::IsExternalLocation(install_source_)) |
| 324 return CrxInstallerError(); | 324 return CrxInstallerError(); |
| 325 | 325 |
| 326 if (!extensions_enabled_) { | 326 if (!extensions_enabled_) { |
| 327 return CrxInstallerError( | 327 return CrxInstallerError( |
| 328 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_NOT_ENABLED)); | 328 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_NOT_ENABLED)); |
| 329 } | 329 } |
| 330 | 330 |
| 331 if (install_cause_ == extension_misc::INSTALL_CAUSE_USER_DOWNLOAD) { | 331 if (install_cause_ == extension_misc::INSTALL_CAUSE_USER_DOWNLOAD) { |
| 332 if (FeatureSwitch::easy_off_store_install()->IsEnabled()) { | 332 if (FeatureSwitch::easy_off_store_install()->IsEnabled()) { |
| 333 const char* kHistogramName = "Extensions.OffStoreInstallDecisionEasy"; | 333 const char kHistogramName[] = "Extensions.OffStoreInstallDecisionEasy"; |
| 334 if (is_gallery_install()) { | 334 if (is_gallery_install()) { |
| 335 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, | 335 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, |
| 336 NumOffStoreInstallDecision); | 336 NumOffStoreInstallDecision); |
| 337 } else { | 337 } else { |
| 338 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, | 338 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, |
| 339 NumOffStoreInstallDecision); | 339 NumOffStoreInstallDecision); |
| 340 } | 340 } |
| 341 } else { | 341 } else { |
| 342 const char* kHistogramName = "Extensions.OffStoreInstallDecisionHard"; | 342 const char kHistogramName[] = "Extensions.OffStoreInstallDecisionHard"; |
| 343 if (is_gallery_install()) { | 343 if (is_gallery_install()) { |
| 344 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, | 344 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, |
| 345 NumOffStoreInstallDecision); | 345 NumOffStoreInstallDecision); |
| 346 } else if (off_store_install_allow_reason_ != OffStoreInstallDisallowed) { | 346 } else if (off_store_install_allow_reason_ != OffStoreInstallDisallowed) { |
| 347 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, | 347 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, |
| 348 NumOffStoreInstallDecision); | 348 NumOffStoreInstallDecision); |
| 349 UMA_HISTOGRAM_ENUMERATION("Extensions.OffStoreInstallAllowReason", | 349 UMA_HISTOGRAM_ENUMERATION("Extensions.OffStoreInstallAllowReason", |
| 350 off_store_install_allow_reason_, | 350 off_store_install_allow_reason_, |
| 351 NumOffStoreInstallAllowReasons); | 351 NumOffStoreInstallAllowReasons); |
| 352 } else { | 352 } else { |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 907 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
| 908 return; | 908 return; |
| 909 | 909 |
| 910 if (client_) { | 910 if (client_) { |
| 911 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 911 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
| 912 client_->ConfirmReEnable(this, extension()); | 912 client_->ConfirmReEnable(this, extension()); |
| 913 } | 913 } |
| 914 } | 914 } |
| 915 | 915 |
| 916 } // namespace extensions | 916 } // namespace extensions |
| OLD | NEW |