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

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

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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 (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
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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) 901 if (!prefs->DidExtensionEscalatePermissions(extension()->id()))
902 return; 902 return;
903 903
904 if (client_) { 904 if (client_) {
905 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 905 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
906 client_->ConfirmReEnable(this, extension()); 906 client_->ConfirmReEnable(this, extension());
907 } 907 }
908 } 908 }
909 909
910 } // namespace extensions 910 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/content_script_apitest.cc ('k') | chrome/browser/extensions/default_apps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698