| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 if (is_gallery_install()) { | 333 if (is_gallery_install()) { |
| 334 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, | 334 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, |
| 335 NumOffStoreInstallDecision); | 335 NumOffStoreInstallDecision); |
| 336 } else { | 336 } else { |
| 337 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, | 337 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, |
| 338 NumOffStoreInstallDecision); | 338 NumOffStoreInstallDecision); |
| 339 } | 339 } |
| 340 } else { | 340 } else { |
| 341 const char kHistogramName[] = "Extensions.OffStoreInstallDecisionHard"; | 341 const char kHistogramName[] = "Extensions.OffStoreInstallDecisionHard"; |
| 342 if (is_gallery_install()) { | 342 if (is_gallery_install()) { |
| 343 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OnStoreInstall, | 343 UMA_HISTOGRAM_ENUMERATION(kHistogramName, |
| 344 OffStoreInstallDecision::OnStoreInstall, |
| 344 NumOffStoreInstallDecision); | 345 NumOffStoreInstallDecision); |
| 345 } else if (off_store_install_allow_reason_ != OffStoreInstallDisallowed) { | 346 } else if (off_store_install_allow_reason_ != OffStoreInstallDisallowed) { |
| 346 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallAllowed, | 347 UMA_HISTOGRAM_ENUMERATION( |
| 347 NumOffStoreInstallDecision); | 348 kHistogramName, OffStoreInstallDecision::OffStoreInstallAllowed, |
| 349 NumOffStoreInstallDecision); |
| 348 UMA_HISTOGRAM_ENUMERATION("Extensions.OffStoreInstallAllowReason", | 350 UMA_HISTOGRAM_ENUMERATION("Extensions.OffStoreInstallAllowReason", |
| 349 off_store_install_allow_reason_, | 351 off_store_install_allow_reason_, |
| 350 NumOffStoreInstallAllowReasons); | 352 NumOffStoreInstallAllowReasons); |
| 351 } else { | 353 } else { |
| 352 UMA_HISTOGRAM_ENUMERATION(kHistogramName, OffStoreInstallDisallowed, | 354 UMA_HISTOGRAM_ENUMERATION( |
| 353 NumOffStoreInstallDecision); | 355 kHistogramName, OffStoreInstallDecision::OffStoreInstallDisallowed, |
| 356 NumOffStoreInstallDecision); |
| 354 // Don't delete source in this case so that the user can install | 357 // Don't delete source in this case so that the user can install |
| 355 // manually if they want. | 358 // manually if they want. |
| 356 delete_source_ = false; | 359 delete_source_ = false; |
| 357 did_handle_successfully_ = false; | 360 did_handle_successfully_ = false; |
| 358 | 361 |
| 359 return CrxInstallError(CrxInstallError::ERROR_OFF_STORE, | 362 return CrxInstallError(CrxInstallError::ERROR_OFF_STORE, |
| 360 l10n_util::GetStringUTF16( | 363 l10n_util::GetStringUTF16( |
| 361 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE)); | 364 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE)); |
| 362 } | 365 } |
| 363 } | 366 } |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension( | 919 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension( |
| 917 service->profile(), extension()); | 920 service->profile(), extension()); |
| 918 client_->ShowDialog(base::Bind(&CrxInstaller::OnInstallPromptDone, this), | 921 client_->ShowDialog(base::Bind(&CrxInstaller::OnInstallPromptDone, this), |
| 919 extension(), nullptr, | 922 extension(), nullptr, |
| 920 base::MakeUnique<ExtensionInstallPrompt::Prompt>(type), | 923 base::MakeUnique<ExtensionInstallPrompt::Prompt>(type), |
| 921 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); | 924 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); |
| 922 } | 925 } |
| 923 } | 926 } |
| 924 | 927 |
| 925 } // namespace extensions | 928 } // namespace extensions |
| OLD | NEW |