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

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

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 #if defined(GOOGLE_CHROME_BUILD) 49 #if defined(GOOGLE_CHROME_BUILD)
50 const char kExperimentName[] = "ExtensionInstallVerification"; 50 const char kExperimentName[] = "ExtensionInstallVerification";
51 #endif // defined(GOOGLE_CHROME_BUILD) 51 #endif // defined(GOOGLE_CHROME_BUILD)
52 52
53 VerifyStatus GetExperimentStatus() { 53 VerifyStatus GetExperimentStatus() {
54 #if defined(GOOGLE_CHROME_BUILD) 54 #if defined(GOOGLE_CHROME_BUILD)
55 const std::string group = base::FieldTrialList::FindFullName( 55 const std::string group = base::FieldTrialList::FindFullName(
56 kExperimentName); 56 kExperimentName);
57 57
58 std::string forced_trials = CommandLine::ForCurrentProcess()-> 58 std::string forced_trials =
59 GetSwitchValueASCII(switches::kForceFieldTrials); 59 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
60 switches::kForceFieldTrials);
60 if (forced_trials.find(kExperimentName) != std::string::npos) { 61 if (forced_trials.find(kExperimentName) != std::string::npos) {
61 // We don't want to allow turning off enforcement by forcing the field 62 // We don't want to allow turning off enforcement by forcing the field
62 // trial group to something other than enforcement. 63 // trial group to something other than enforcement.
63 return ENFORCE_STRICT; 64 return ENFORCE_STRICT;
64 } 65 }
65 66
66 VerifyStatus default_status = NONE; 67 VerifyStatus default_status = NONE;
67 68
68 if (group == "EnforceStrict") 69 if (group == "EnforceStrict")
69 return ENFORCE_STRICT; 70 return ENFORCE_STRICT;
70 else if (group == "Enforce") 71 else if (group == "Enforce")
71 return ENFORCE; 72 return ENFORCE;
72 else if (group == "Bootstrap") 73 else if (group == "Bootstrap")
73 return BOOTSTRAP; 74 return BOOTSTRAP;
74 else if (group == "None" || group == "Control") 75 else if (group == "None" || group == "Control")
75 return NONE; 76 return NONE;
76 else 77 else
77 return default_status; 78 return default_status;
78 #endif // defined(GOOGLE_CHROME_BUILD) 79 #endif // defined(GOOGLE_CHROME_BUILD)
79 80
80 return NONE; 81 return NONE;
81 } 82 }
82 83
83 VerifyStatus GetCommandLineStatus() { 84 VerifyStatus GetCommandLineStatus() {
84 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); 85 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
85 if (!InstallSigner::GetForcedNotFromWebstore().empty()) 86 if (!InstallSigner::GetForcedNotFromWebstore().empty())
86 return ENFORCE; 87 return ENFORCE;
87 88
88 if (cmdline->HasSwitch(switches::kExtensionsInstallVerification)) { 89 if (cmdline->HasSwitch(switches::kExtensionsInstallVerification)) {
89 std::string value = cmdline->GetSwitchValueASCII( 90 std::string value = cmdline->GetSwitchValueASCII(
90 switches::kExtensionsInstallVerification); 91 switches::kExtensionsInstallVerification);
91 if (value == "bootstrap") 92 if (value == "bootstrap")
92 return BOOTSTRAP; 93 return BOOTSTRAP;
93 else if (value == "enforce_strict") 94 else if (value == "enforce_strict")
94 return ENFORCE_STRICT; 95 return ENFORCE_STRICT;
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 630 }
630 631
631 OnVerificationComplete(success, operation->type); 632 OnVerificationComplete(success, operation->type);
632 } 633 }
633 634
634 if (!operation_queue_.empty()) 635 if (!operation_queue_.empty())
635 BeginFetch(); 636 BeginFetch();
636 } 637 }
637 638
638 } // namespace extensions 639 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_signer.cc ('k') | chrome/browser/extensions/location_bar_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698