diff options
Diffstat (limited to 'chrome/browser')
282 files changed, 824 insertions, 750 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 8e458b7..963abca 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -119,22 +119,22 @@ void AddOsStrings(unsigned bitmask, base::ListValue* list) { } // Convert switch constants to proper CommandLine::StringType strings. -CommandLine::StringType GetSwitchString(const std::string& flag) { - CommandLine cmd_line(CommandLine::NO_PROGRAM); +base::CommandLine::StringType GetSwitchString(const std::string& flag) { + base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM); cmd_line.AppendSwitch(flag); DCHECK_EQ(2U, cmd_line.argv().size()); return cmd_line.argv()[1]; } // Scoops flags from a command line. -std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( - const CommandLine& cmdline) { - std::set<CommandLine::StringType> flags; +std::set<base::CommandLine::StringType> ExtractFlagsFromCommandLine( + const base::CommandLine& cmdline) { + std::set<base::CommandLine::StringType> flags; // First do the ones between --flag-switches-begin and --flag-switches-end. - CommandLine::StringVector::const_iterator first = + base::CommandLine::StringVector::const_iterator first = std::find(cmdline.argv().begin(), cmdline.argv().end(), GetSwitchString(switches::kFlagSwitchesBegin)); - CommandLine::StringVector::const_iterator last = + base::CommandLine::StringVector::const_iterator last = std::find(cmdline.argv().begin(), cmdline.argv().end(), GetSwitchString(switches::kFlagSwitchesEnd)); if (first != cmdline.argv().end() && last != cmdline.argv().end()) @@ -2101,7 +2101,7 @@ class FlagsState { public: FlagsState() : needs_restart_(false) {} void ConvertFlagsToSwitches(FlagsStorage* flags_storage, - CommandLine* command_line, + base::CommandLine* command_line, SentinelsMode sentinels); bool IsRestartNeededToCommitChanges(); void SetExperimentEnabled( @@ -2109,7 +2109,7 @@ class FlagsState { const std::string& internal_name, bool enable); void RemoveFlagsSwitches( - std::map<std::string, CommandLine::StringType>* switch_list); + std::map<std::string, base::CommandLine::StringType>* switch_list); void ResetAllFlags(FlagsStorage* flags_storage); void reset(); @@ -2291,7 +2291,7 @@ base::string16 Experiment::DescriptionForChoice(int index) const { } void ConvertFlagsToSwitches(FlagsStorage* flags_storage, - CommandLine* command_line, + base::CommandLine* command_line, SentinelsMode sentinels) { FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage, command_line, @@ -2299,12 +2299,12 @@ void ConvertFlagsToSwitches(FlagsStorage* flags_storage, } bool AreSwitchesIdenticalToCurrentCommandLine( - const CommandLine& new_cmdline, - const CommandLine& active_cmdline, - std::set<CommandLine::StringType>* out_difference) { - std::set<CommandLine::StringType> new_flags = + const base::CommandLine& new_cmdline, + const base::CommandLine& active_cmdline, + std::set<base::CommandLine::StringType>* out_difference) { + std::set<base::CommandLine::StringType> new_flags = ExtractFlagsFromCommandLine(new_cmdline); - std::set<CommandLine::StringType> active_flags = + std::set<base::CommandLine::StringType> active_flags = ExtractFlagsFromCommandLine(active_cmdline); bool result = false; @@ -2392,7 +2392,7 @@ void SetExperimentEnabled(FlagsStorage* flags_storage, } void RemoveFlagsSwitches( - std::map<std::string, CommandLine::StringType>* switch_list) { + std::map<std::string, base::CommandLine::StringType>* switch_list) { FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list); } @@ -2479,7 +2479,7 @@ void SetFlagToSwitchMapping(const std::string& key, } void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage, - CommandLine* command_line, + base::CommandLine* command_line, SentinelsMode sentinels) { if (command_line->HasSwitch(switches::kNoExperiments)) return; @@ -2617,7 +2617,7 @@ void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage, } void FlagsState::RemoveFlagsSwitches( - std::map<std::string, CommandLine::StringType>* switch_list) { + std::map<std::string, base::CommandLine::StringType>* switch_list) { for (const auto& entry : flags_switches_) switch_list->erase(entry.first); } diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h index 6525b1d..055d8b5 100644 --- a/chrome/browser/about_flags.h +++ b/chrome/browser/about_flags.h @@ -121,7 +121,7 @@ void ConvertFlagsToSwitches(FlagsStorage* flags_storage, bool AreSwitchesIdenticalToCurrentCommandLine( const base::CommandLine& new_cmdline, const base::CommandLine& active_cmdline, - std::set<CommandLine::StringType>* out_difference); + std::set<base::CommandLine::StringType>* out_difference); // Differentiate between generic flags available on a per session base and flags // that influence the whole machine and can be said by the admin only. This flag diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc index 3d23dee..1c1c6f1 100644 --- a/chrome/browser/about_flags_unittest.cc +++ b/chrome/browser/about_flags_unittest.cc @@ -385,7 +385,7 @@ TEST_F(AboutFlagsTest, AddTwoFlagsRemoveBoth) { TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { SetExperimentEnabled(&flags_storage_, kFlags1, true); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitch("foo"); EXPECT_TRUE(command_line.HasSwitch("foo")); @@ -398,7 +398,7 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { EXPECT_TRUE(command_line.HasSwitch(switches::kFlagSwitchesBegin)); EXPECT_TRUE(command_line.HasSwitch(switches::kFlagSwitchesEnd)); - CommandLine command_line2(CommandLine::NO_PROGRAM); + base::CommandLine command_line2(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line2, kNoSentinels); @@ -407,7 +407,7 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { EXPECT_FALSE(command_line2.HasSwitch(switches::kFlagSwitchesEnd)); } -CommandLine::StringType CreateSwitch(const std::string& value) { +base::CommandLine::StringType CreateSwitch(const std::string& value) { #if defined(OS_WIN) return base::ASCIIToUTF16(value); #else @@ -420,16 +420,16 @@ TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { const std::string kDoubleDash("--"); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitch("foo"); - CommandLine new_command_line(CommandLine::NO_PROGRAM); + base::CommandLine new_command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &new_command_line, kAddSentinels); EXPECT_FALSE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, command_line, NULL)); { - std::set<CommandLine::StringType> difference; + std::set<base::CommandLine::StringType> difference; EXPECT_FALSE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, command_line, &difference)); EXPECT_EQ(1U, difference.size()); @@ -441,7 +441,7 @@ TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { EXPECT_TRUE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, command_line, NULL)); { - std::set<CommandLine::StringType> difference; + std::set<base::CommandLine::StringType> difference; EXPECT_TRUE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, command_line, &difference)); EXPECT_TRUE(difference.empty()); @@ -451,13 +451,13 @@ TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { SetExperimentEnabled(&flags_storage_, kFlags1, false); SetExperimentEnabled(&flags_storage_, kFlags2, true); - CommandLine another_command_line(CommandLine::NO_PROGRAM); + base::CommandLine another_command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &another_command_line, kAddSentinels); EXPECT_FALSE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, another_command_line, NULL)); { - std::set<CommandLine::StringType> difference; + std::set<base::CommandLine::StringType> difference; EXPECT_FALSE(AreSwitchesIdenticalToCurrentCommandLine( new_command_line, another_command_line, &difference)); EXPECT_EQ(2U, difference.size()); @@ -469,11 +469,11 @@ TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { } TEST_F(AboutFlagsTest, RemoveFlagSwitches) { - std::map<std::string, CommandLine::StringType> switch_list; - switch_list[kSwitch1] = CommandLine::StringType(); - switch_list[switches::kFlagSwitchesBegin] = CommandLine::StringType(); - switch_list[switches::kFlagSwitchesEnd] = CommandLine::StringType(); - switch_list["foo"] = CommandLine::StringType(); + std::map<std::string, base::CommandLine::StringType> switch_list; + switch_list[kSwitch1] = base::CommandLine::StringType(); + switch_list[switches::kFlagSwitchesBegin] = base::CommandLine::StringType(); + switch_list[switches::kFlagSwitchesEnd] = base::CommandLine::StringType(); + switch_list["foo"] = base::CommandLine::StringType(); SetExperimentEnabled(&flags_storage_, kFlags1, true); @@ -488,7 +488,7 @@ TEST_F(AboutFlagsTest, RemoveFlagSwitches) { EXPECT_TRUE(switch_list.find("foo") != switch_list.end()); // Call ConvertFlagsToSwitches(), then RemoveFlagsSwitches() again. - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitch("foo"); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); RemoveFlagsSwitches(&switch_list); @@ -503,7 +503,7 @@ TEST_F(AboutFlagsTest, PersistAndPrune) { // Enable experiments 1 and 3. SetExperimentEnabled(&flags_storage_, kFlags1, true); SetExperimentEnabled(&flags_storage_, kFlags3, true); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kSwitch3)); @@ -532,7 +532,7 @@ TEST_F(AboutFlagsTest, CheckValues) { // Enable experiments 1 and 2. SetExperimentEnabled(&flags_storage_, kFlags1, true); SetExperimentEnabled(&flags_storage_, kFlags2, true); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); @@ -591,7 +591,7 @@ TEST_F(AboutFlagsTest, MultiValues) { // Initially, the first "deactivated" option of the multi experiment should // be set. { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch2)); @@ -600,7 +600,7 @@ TEST_F(AboutFlagsTest, MultiValues) { // Enable the 2nd choice of the multi-value. SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(2), true); { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1)); EXPECT_TRUE(command_line.HasSwitch(kMultiSwitch2)); @@ -611,7 +611,7 @@ TEST_F(AboutFlagsTest, MultiValues) { // Disable the multi-value experiment. SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(0), true); { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch2)); @@ -624,7 +624,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) { // Nothing selected. { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); @@ -633,7 +633,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) { // "Enable" option selected. SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(1), true); { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); @@ -643,7 +643,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) { // "Disable" option selected. SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(2), true); { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); EXPECT_TRUE(command_line.HasSwitch(kSwitch2)); @@ -653,7 +653,7 @@ TEST_F(AboutFlagsTest, EnableDisableValues) { // "Default" option selected, same as nothing selected. SetExperimentEnabled(&flags_storage_, experiment.NameForChoice(0), true); { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch1)); EXPECT_FALSE(command_line.HasSwitch(kMultiSwitch2)); diff --git a/chrome/browser/accessibility/accessibility_extension_apitest.cc b/chrome/browser/accessibility/accessibility_extension_apitest.cc index 55a9aa0..f51977c 100644 --- a/chrome/browser/accessibility/accessibility_extension_apitest.cc +++ b/chrome/browser/accessibility/accessibility_extension_apitest.cc @@ -21,7 +21,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -36,7 +37,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_GetAlertsForTab) { SimpleAlertInfoBarDelegate::Create(infobar_service, infobars::InfoBarDelegate::kNoIconID, base::ASCIIToUTF16(kAlertMessage), false); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); ASSERT_TRUE(RunComponentExtensionTest("accessibility/get_alerts_for_tab")) << message_; diff --git a/chrome/browser/android/chrome_startup_flags.cc b/chrome/browser/android/chrome_startup_flags.cc index d5d200f..83b4664 100644 --- a/chrome/browser/android/chrome_startup_flags.cc +++ b/chrome/browser/android/chrome_startup_flags.cc @@ -20,14 +20,14 @@ namespace { void SetCommandLineSwitch(const std::string& switch_string) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switch_string)) command_line->AppendSwitch(switch_string); } void SetCommandLineSwitchASCII(const std::string& switch_string, const std::string& value) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switch_string)) command_line->AppendSwitchASCII(switch_string, value); } diff --git a/chrome/browser/android/chrome_web_contents_delegate_android.cc b/chrome/browser/android/chrome_web_contents_delegate_android.cc index 56da4aa..1bf06ae9 100644 --- a/chrome/browser/android/chrome_web_contents_delegate_android.cc +++ b/chrome/browser/android/chrome_web_contents_delegate_android.cc @@ -281,7 +281,7 @@ WebContents* ChromeWebContentsDelegateAndroid::OpenURLFromTab( params.disposition == NEW_BACKGROUND_TAB || params.disposition == NEW_WINDOW) && !params.user_gesture && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisablePopupBlocking)) { if (popup_blocker_helper->MaybeBlockPopup(nav_params, blink::WebWindowFeatures())) { diff --git a/chrome/browser/android/dev_tools_server.cc b/chrome/browser/android/dev_tools_server.cc index da5ac36..83477f5 100644 --- a/chrome/browser/android/dev_tools_server.cc +++ b/chrome/browser/android/dev_tools_server.cc @@ -183,7 +183,8 @@ DevToolsServer::DevToolsServer(const std::string& socket_name_prefix) : socket_name_(base::StringPrintf(kDevToolsChannelNameFormat, socket_name_prefix.c_str())) { // Override the socket name if one is specified on the command line. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { socket_name_ = command_line.GetSwitchValueASCII( switches::kRemoteDebuggingSocketName); diff --git a/chrome/browser/android/dom_distiller/feedback_reporter_android.cc b/chrome/browser/android/dom_distiller/feedback_reporter_android.cc index f90c07d..c7d720c 100644 --- a/chrome/browser/android/dom_distiller/feedback_reporter_android.cc +++ b/chrome/browser/android/dom_distiller/feedback_reporter_android.cc @@ -22,7 +22,7 @@ namespace android { // static jboolean IsEnabled(JNIEnv* env, jclass clazz) { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableDomDistiller); } diff --git a/chrome/browser/android/voice_search_tab_helper.cc b/chrome/browser/android/voice_search_tab_helper.cc index 0782f75..0edb753 100644 --- a/chrome/browser/android/voice_search_tab_helper.cc +++ b/chrome/browser/android/voice_search_tab_helper.cc @@ -24,7 +24,8 @@ static void UpdateAutoplayStatus(JNIEnv* env, jobject j_web_contents) { // In the case where media autoplay has been disabled by default (e.g. in // performance media tests) do not update it based on navigation changes. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch( switches::kDisableGestureRequirementForMediaPlayback)) return; diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 32e82339..082dcca 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -430,7 +430,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { // sessions. if (!browser_shutdown::IsTryingToQuit() && quitWithAppsController_.get() && !quitWithAppsController_->ShouldQuit()) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kHostedAppQuitNotification)) { return NO; } @@ -1387,9 +1387,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { if (!profile_manager) return NULL; - return profile_manager->GetProfile(GetStartupProfilePath( - profile_manager->user_data_dir(), - *CommandLine::ForCurrentProcess())); + return profile_manager->GetProfile( + GetStartupProfilePath(profile_manager->user_data_dir(), + *base::CommandLine::ForCurrentProcess())); } - (Profile*)safeLastProfileForNewWindows { @@ -1429,7 +1429,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { browser->window()->Show(); } - CommandLine dummy(CommandLine::NO_PROGRAM); + base::CommandLine dummy(base::CommandLine::NO_PROGRAM); chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run); diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm index 603284e..d72b6f9 100644 --- a/chrome/browser/app_controller_mac_browsertest.mm +++ b/chrome/browser/app_controller_mac_browsertest.mm @@ -106,7 +106,7 @@ class AppControllerPlatformAppBrowserTest chrome::GetActiveDesktop())) { } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { PlatformAppBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kAppId, "1234"); @@ -162,7 +162,7 @@ class AppControllerWebAppBrowserTest : public InProcessBrowserTest { chrome::GetActiveDesktop())) { } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kApp, GetAppURL()); } @@ -223,7 +223,7 @@ class AppControllerNewProfileManagementBrowserTest chrome::GetActiveDesktop())) { } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { switches::EnableNewProfileManagementForTesting(command_line); } @@ -362,7 +362,7 @@ class AppControllerOpenShortcutBrowserTest : public InProcessBrowserTest { g_open_shortcut_url = embedded_test_server()->GetURL("/simple.html"); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { // If the arg is empty, PrepareTestCommandLine() after this function will // append about:blank as default url. command_line->AppendArg(chrome::kChromeUINewTabURL); @@ -385,7 +385,7 @@ class AppControllerReplaceNTPBrowserTest : public InProcessBrowserTest { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { // If the arg is empty, PrepareTestCommandLine() after this function will // append about:blank as default url. command_line->AppendArg(chrome::kChromeUINewTabURL); diff --git a/chrome/browser/app_mode/app_mode_utils.cc b/chrome/browser/app_mode/app_mode_utils.cc index 25b6855..14c37ba 100644 --- a/chrome/browser/app_mode/app_mode_utils.cc +++ b/chrome/browser/app_mode/app_mode_utils.cc @@ -39,13 +39,13 @@ bool IsCommandAllowedInAppMode(int command_id) { } bool IsRunningInAppMode() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); return command_line->HasSwitch(switches::kKioskMode) || IsRunningInForcedAppMode(); } bool IsRunningInForcedAppMode() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); return command_line->HasSwitch(switches::kForceAppMode) && command_line->HasSwitch(switches::kAppId); } diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc index 261ef80..90c43a3 100644 --- a/chrome/browser/apps/app_browsertest.cc +++ b/chrome/browser/apps/app_browsertest.cc @@ -183,7 +183,7 @@ bool CopyTestDataAndSetCommandLineArg( if (!(base::CopyFile(test_data_file, path))) return false; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendArgPath(path); return true; } @@ -496,7 +496,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFile) { IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithRelativeFile) { // Setup the command line ClearCommandLineArgs(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::FilePath relative_test_doc = base::FilePath::FromUTF8Unsafe(kTestFilePath); relative_test_doc = relative_test_doc.NormalizePathSeparators(); @@ -511,7 +511,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithRelativeFile) { // Run the test AppLaunchParams params(browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW, extensions::SOURCE_TEST); - params.command_line = *CommandLine::ForCurrentProcess(); + params.command_line = *base::CommandLine::ForCurrentProcess(); params.current_directory = test_data_dir_; OpenApplication(params); @@ -695,7 +695,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNewFile) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ClearCommandLineArgs(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendArgPath(temp_dir.path().AppendASCII("new_file.txt")); ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_new_file")) << message_; } @@ -864,7 +864,8 @@ void PlatformAppDevToolsBrowserTest::RunTestWithDevTools( IN_PROC_BROWSER_TEST_F(PlatformAppDevToolsBrowserTest, MAYBE_ReOpenedWithID) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunTestWithDevTools("minimal_id", RELAUNCH | HAS_ID); @@ -1179,7 +1180,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, class PlatformAppIncognitoBrowserTest : public PlatformAppBrowserTest, public AppWindowRegistry::Observer { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { // Tell chromeos to launch in Guest mode, aka incognito. command_line->AppendSwitch(switches::kIncognito); PlatformAppBrowserTest::SetUpCommandLine(command_line); diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc index 59f913f..712a2c6 100644 --- a/chrome/browser/apps/app_browsertest_util.cc +++ b/chrome/browser/apps/app_browsertest_util.cc @@ -40,7 +40,7 @@ PlatformAppBrowserTest::PlatformAppBrowserTest() { ChromeAppDelegate::DisableExternalOpenForTesting(); } -void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { +void PlatformAppBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { // Skips ExtensionApiTest::SetUpCommandLine. ExtensionBrowserTest::SetUpCommandLine(command_line); @@ -196,9 +196,9 @@ size_t PlatformAppBrowserTest::GetAppWindowCountForApp( } void PlatformAppBrowserTest::ClearCommandLineArgs() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); - CommandLine::StringVector args = command_line->GetArgs(); - CommandLine::StringVector argv = command_line->argv(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringVector args = command_line->GetArgs(); + base::CommandLine::StringVector argv = command_line->argv(); for (size_t i = 0; i < args.size(); i++) argv.pop_back(); command_line->InitFromArgv(argv); @@ -206,7 +206,7 @@ void PlatformAppBrowserTest::ClearCommandLineArgs() { void PlatformAppBrowserTest::SetCommandLineArg(const std::string& test_file) { ClearCommandLineArgs(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::FilePath test_doc(test_data_dir_.AppendASCII(test_file)); test_doc = test_doc.NormalizePathSeparators(); command_line->AppendArgPath(test_doc); @@ -271,7 +271,7 @@ AppWindow* PlatformAppBrowserTest::CreateTestAppWindow( } void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { PlatformAppBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); } diff --git a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm index e2e4982..2b1e002 100644 --- a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm +++ b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm @@ -409,7 +409,7 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_HostedAppLaunch) { // Case 2: Launch the shim, it should start the hosted app. { HostedAppBrowserListObserver listener(app->id()); - CommandLine shim_cmdline(CommandLine::NO_PROGRAM); + base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM); shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest); ProcessSerialNumber shim_psn; ASSERT_TRUE(base::mac::OpenApplicationWithPath( @@ -483,7 +483,7 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_Launch) { // Case 2: Launch the shim, it should start the app. { ExtensionTestMessageListener launched_listener("Launched", false); - CommandLine shim_cmdline(CommandLine::NO_PROGRAM); + base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM); shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest); ProcessSerialNumber shim_psn; ASSERT_TRUE(base::mac::OpenApplicationWithPath( @@ -692,7 +692,7 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_RebuildShim) { // (3) After rebuilding, Chrome again launches the shim and expects it to // behave normally. ExtensionTestMessageListener launched_listener("Launched", false); - CommandLine shim_cmdline(CommandLine::NO_PROGRAM); + base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM); ASSERT_TRUE(base::mac::OpenApplicationWithPath( shim_path, shim_cmdline, kLSLaunchDefaults, NULL)); diff --git a/chrome/browser/apps/app_shim/app_shim_quit_interactive_uitest_mac.mm b/chrome/browser/apps/app_shim/app_shim_quit_interactive_uitest_mac.mm index 556005e..acb90ed 100644 --- a/chrome/browser/apps/app_shim/app_shim_quit_interactive_uitest_mac.mm +++ b/chrome/browser/apps/app_shim/app_shim_quit_interactive_uitest_mac.mm @@ -85,7 +85,7 @@ class AppShimQuitTest : public PlatformAppBrowserTest { content::RunAllPendingInMessageLoop(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { PlatformAppBrowserTest::SetUpCommandLine(command_line); // Simulate an app shim initiated launch, i.e. launch app but not browser. app_path_ = test_data_dir_ diff --git a/chrome/browser/apps/app_url_redirector_browsertest.cc b/chrome/browser/apps/app_url_redirector_browsertest.cc index 4d9b243..43721da 100644 --- a/chrome/browser/apps/app_url_redirector_browsertest.cc +++ b/chrome/browser/apps/app_url_redirector_browsertest.cc @@ -20,7 +20,7 @@ namespace extensions { class PlatformAppUrlRedirectorBrowserTest : public PlatformAppBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override; + void SetUpCommandLine(base::CommandLine* command_line) override; protected: // Performs the following sequence: @@ -112,9 +112,8 @@ class PlatformAppUrlRedirectorBrowserTest : public PlatformAppBrowserTest { const char* handler); }; - void PlatformAppUrlRedirectorBrowserTest::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { PlatformAppBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(::switches::kDisablePopupBlocking); command_line->AppendSwitchASCII(::switches::kPrerenderMode, diff --git a/chrome/browser/apps/ephemeral_app_launcher.cc b/chrome/browser/apps/ephemeral_app_launcher.cc index cdea28f..0a17700 100644 --- a/chrome/browser/apps/ephemeral_app_launcher.cc +++ b/chrome/browser/apps/ephemeral_app_launcher.cc @@ -98,8 +98,9 @@ bool EphemeralAppLauncher::IsFeatureEnabled() { // static bool EphemeralAppLauncher::IsFeatureEnabledInWebstore() { - return IsFeatureEnabled() && CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableEphemeralAppsInWebstore); + return IsFeatureEnabled() && + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableEphemeralAppsInWebstore); } // static diff --git a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc index c1c3272..b1e161e 100644 --- a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc +++ b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc @@ -313,7 +313,7 @@ class EphemeralAppLauncherTestDisabled : public EphemeralAppLauncherTest { // Verifies that an ephemeral app will not be installed and launched if the // feature is disabled. IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTestDisabled, FeatureDisabled) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( app_list::switches::kDisableExperimentalAppList); RunLaunchTest( kDefaultAppCrxFilename, webstore_install::LAUNCH_FEATURE_DISABLED, false); diff --git a/chrome/browser/apps/ephemeral_app_service.cc b/chrome/browser/apps/ephemeral_app_service.cc index 36c8cda..6eb8da8 100644 --- a/chrome/browser/apps/ephemeral_app_service.cc +++ b/chrome/browser/apps/ephemeral_app_service.cc @@ -190,7 +190,7 @@ void EphemeralAppService::Init() { apps::AppLifetimeMonitorFactory::GetForProfile(profile_)); // Execute startup clean up tasks (except during tests). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) return; TriggerGarbageCollect( diff --git a/chrome/browser/apps/ephemeral_app_throttle.cc b/chrome/browser/apps/ephemeral_app_throttle.cc index e562c82..1ebd54f 100644 --- a/chrome/browser/apps/ephemeral_app_throttle.cc +++ b/chrome/browser/apps/ephemeral_app_throttle.cc @@ -66,7 +66,7 @@ content::ResourceThrottle* EphemeralAppThrottle::MaybeCreateThrottleForLaunch( net::URLRequest* request, ProfileIOData* profile_io_data) { - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableLinkableEphemeralApps)) return NULL; diff --git a/chrome/browser/apps/guest_view/app_view_browsertest.cc b/chrome/browser/apps/guest_view/app_view_browsertest.cc index 6c9c94f..8ddc15d 100644 --- a/chrome/browser/apps/guest_view/app_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/app_view_browsertest.cc @@ -130,7 +130,7 @@ class AppViewTest : public extensions::PlatformAppBrowserTest { } private: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); } diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index c579a6c..432c4e5 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc @@ -324,7 +324,7 @@ class WebViewTest : public extensions::PlatformAppBrowserTest { } } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); @@ -743,7 +743,7 @@ class WebViewTest : public extensions::PlatformAppBrowserTest { class WebViewDPITest : public WebViewTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { WebViewTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale())); @@ -2294,7 +2294,7 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, NoContentSettingsAPI) { #if defined(ENABLE_PLUGINS) class WebViewPluginTest : public WebViewTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { WebViewTest::SetUpCommandLine(command_line); // Append the switch to register the pepper plugin. diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc index d34f51c..c23f22f 100644 --- a/chrome/browser/apps/shortcut_manager.cc +++ b/chrome/browser/apps/shortcut_manager.cc @@ -154,7 +154,7 @@ void AppShortcutManager::OnProfileWillBeRemoved( } void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) return; int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion); diff --git a/chrome/browser/apps/speech_recognition_browsertest.cc b/chrome/browser/apps/speech_recognition_browsertest.cc index 7a4fbc1..e413aa5 100644 --- a/chrome/browser/apps/speech_recognition_browsertest.cc +++ b/chrome/browser/apps/speech_recognition_browsertest.cc @@ -31,7 +31,7 @@ class SpeechRecognitionTest : public extensions::PlatformAppBrowserTest { extensions::PlatformAppBrowserTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); diff --git a/chrome/browser/apps/window_controls_browsertest.cc b/chrome/browser/apps/window_controls_browsertest.cc index 75feeab..6d4b76a 100644 --- a/chrome/browser/apps/window_controls_browsertest.cc +++ b/chrome/browser/apps/window_controls_browsertest.cc @@ -11,7 +11,7 @@ class WindowControlsTest : public extensions::PlatformAppBrowserTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(extensions::switches::kEnableAppWindowControls); } diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc index 6eb96b0..0f4e6cb 100644 --- a/chrome/browser/autocomplete/autocomplete_browsertest.cc +++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc @@ -70,7 +70,8 @@ class AutocompleteBrowserTest : public ExtensionBrowserTest { IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -120,7 +121,8 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, MAYBE_Autocomplete) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -166,7 +168,8 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, MAYBE_Autocomplete) { IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, TabAwayRevertSelect) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -194,7 +197,8 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, TabAwayRevertSelect) { IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc index c84d83e..d6ccc09 100644 --- a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc @@ -545,7 +545,7 @@ TEST_F(AutocompleteProviderTest, AllowExactKeywordMatch) { // query params set on the command line. TEST_F(AutocompleteProviderTest, ExtraQueryParams) { ResetControllerWithKeywordAndSearchProviders(); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kExtraSearchQueryParams, "a=b"); RunExactKeymatchTest(true); CopyResults(); diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 459eb38..067a3c1 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -1159,9 +1159,9 @@ TEST_F(SearchProviderTest, CommandLineOverrides) { turl_model->Add(default_t_url_); turl_model->SetUserSelectedDefaultSearchProvider(default_t_url_); - CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL, - "http://www.bar.com/"); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kGoogleBaseURL, "http://www.bar.com/"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kExtraSearchQueryParams, "a=b"); TestData cases[] = { @@ -3325,7 +3325,7 @@ TEST_F(SearchProviderTest, CheckDuplicateMatchesSaved) { } TEST_F(SearchProviderTest, SuggestQueryUsesToken) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableAnswersInSuggest); TemplateURLService* turl_model = diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 1eb2d13..975d742 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -487,7 +487,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, PrefsStringSavedAsIs) { IN_PROC_BROWSER_TEST_F(AutofillTest, InvalidCreditCardNumberIsNotAggregated) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -507,7 +508,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, WhitespacesAndSeparatorCharsStrippedForValidCCNums) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -769,7 +771,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, UsePlusSignForInternationalNumber) { IN_PROC_BROWSER_TEST_F(AutofillTest, CCInfoNotStoredWhenAutocompleteOff) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index 65da55f..f502748 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -253,7 +253,8 @@ const char kFrameNameKey[] = "name"; int BackgroundContentsService::restart_delay_in_ms_ = 3000; // 3 seconds. BackgroundContentsService::BackgroundContentsService( - Profile* profile, const CommandLine* command_line) + Profile* profile, + const base::CommandLine* command_line) : prefs_(NULL), extension_registry_observer_(this) { // Don't load/store preferences if the parent profile is incognito. if (!profile->IsOffTheRecord()) diff --git a/chrome/browser/background/background_contents_service_factory.cc b/chrome/browser/background/background_contents_service_factory.cc index 4289e8b..e15f860 100644 --- a/chrome/browser/background/background_contents_service_factory.cc +++ b/chrome/browser/background/background_contents_service_factory.cc @@ -40,7 +40,7 @@ BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { KeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor( content::BrowserContext* profile) const { return new BackgroundContentsService(static_cast<Profile*>(profile), - CommandLine::ForCurrentProcess()); + base::CommandLine::ForCurrentProcess()); } void BackgroundContentsServiceFactory::RegisterProfilePrefs( diff --git a/chrome/browser/background/background_contents_service_unittest.cc b/chrome/browser/background/background_contents_service_unittest.cc index c0fc954..4b23a0d 100644 --- a/chrome/browser/background/background_contents_service_unittest.cc +++ b/chrome/browser/background/background_contents_service_unittest.cc @@ -43,7 +43,7 @@ class BackgroundContentsServiceTest : public testing::Test { BackgroundContentsServiceTest() {} ~BackgroundContentsServiceTest() override {} void SetUp() override { - command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); + command_line_.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); } const base::DictionaryValue* GetPrefs(Profile* profile) { @@ -62,7 +62,7 @@ class BackgroundContentsServiceTest : public testing::Test { return url; } - scoped_ptr<CommandLine> command_line_; + scoped_ptr<base::CommandLine> command_line_; }; class MockBackgroundContents : public BackgroundContents { diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index 1e3f2d1..c0ea9770 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc @@ -203,9 +203,8 @@ bool BackgroundModeManager::BackgroundModeData::BackgroundModeDataCompare( /////////////////////////////////////////////////////////////////////////////// // BackgroundModeManager, public -BackgroundModeManager::BackgroundModeManager( - CommandLine* command_line, - ProfileInfoCache* profile_cache) +BackgroundModeManager::BackgroundModeManager(base::CommandLine* command_line, + ProfileInfoCache* profile_cache) : profile_cache_(profile_cache), status_tray_(NULL), status_icon_(NULL), diff --git a/chrome/browser/background/background_mode_manager_mac.mm b/chrome/browser/background/background_mode_manager_mac.mm index 51e5d52..3b1dd7d 100644 --- a/chrome/browser/background/background_mode_manager_mac.mm +++ b/chrome/browser/background/background_mode_manager_mac.mm @@ -87,7 +87,7 @@ void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { // default user-data-dir. So if a user is running multiple instances of // Chrome with different user-data-dirs, they won't conflict in their // use of LoginItems. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) return; // There are a few cases we need to handle: diff --git a/chrome/browser/background/background_mode_manager_unittest.cc b/chrome/browser/background/background_mode_manager_unittest.cc index 402917b..66f0e71 100644 --- a/chrome/browser/background/background_mode_manager_unittest.cc +++ b/chrome/browser/background/background_mode_manager_unittest.cc @@ -38,8 +38,8 @@ namespace { // exposes them via getters. class SimpleTestBackgroundModeManager : public BackgroundModeManager { public: - SimpleTestBackgroundModeManager( - CommandLine* command_line, ProfileInfoCache* cache) + SimpleTestBackgroundModeManager(base::CommandLine* command_line, + ProfileInfoCache* cache) : BackgroundModeManager(command_line, cache), have_status_tray_(false), launch_on_startup_(false), @@ -93,8 +93,9 @@ class TestStatusIcon : public StatusIcon { // smaller tests that don't have to install/uninstall extensions. class TestBackgroundModeManager : public SimpleTestBackgroundModeManager { public: - TestBackgroundModeManager( - CommandLine* command_line, ProfileInfoCache* cache, bool enabled) + TestBackgroundModeManager(base::CommandLine* command_line, + ProfileInfoCache* cache, + bool enabled) : SimpleTestBackgroundModeManager(command_line, cache), enabled_(enabled), app_count_(0), @@ -154,11 +155,11 @@ class BackgroundModeManagerTest : public testing::Test { BackgroundModeManagerTest() {} ~BackgroundModeManagerTest() override {} void SetUp() override { - command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); + command_line_.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); profile_manager_ = CreateTestingProfileManager(); profile_ = profile_manager_->CreateTestingProfile("p1"); } - scoped_ptr<CommandLine> command_line_; + scoped_ptr<base::CommandLine> command_line_; protected: scoped_refptr<extensions::Extension> CreateExtension( @@ -596,10 +597,9 @@ TEST_F(BackgroundModeManagerWithExtensionsTest, BackgroundMenuGeneration) { "ID-4")); static_cast<extensions::TestExtensionSystem*>( - extensions::ExtensionSystem::Get(profile_))->CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + extensions::ExtensionSystem::Get(profile_)) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); ExtensionService* service = extensions::ExtensionSystem::Get(profile_)->extension_service(); service->Init(); @@ -674,10 +674,9 @@ TEST_F(BackgroundModeManagerWithExtensionsTest, "ID-4")); static_cast<extensions::TestExtensionSystem*>( - extensions::ExtensionSystem::Get(profile_))->CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + extensions::ExtensionSystem::Get(profile_)) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); ExtensionService* service1 = extensions::ExtensionSystem::Get(profile_)->extension_service(); service1->Init(); @@ -688,10 +687,9 @@ TEST_F(BackgroundModeManagerWithExtensionsTest, service1->AddExtension(regular_extension_with_options.get()); static_cast<extensions::TestExtensionSystem*>( - extensions::ExtensionSystem::Get(profile2))->CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + extensions::ExtensionSystem::Get(profile2)) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); ExtensionService* service2 = extensions::ExtensionSystem::Get(profile2)->extension_service(); service2->Init(); @@ -840,10 +838,9 @@ TEST_F(BackgroundModeManagerWithExtensionsTest, BalloonDisplay) { "ID-3")); static_cast<extensions::TestExtensionSystem*>( - extensions::ExtensionSystem::Get(profile_))->CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + extensions::ExtensionSystem::Get(profile_)) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); ExtensionService* service = extensions::ExtensionSystem::Get(profile_)->extension_service(); diff --git a/chrome/browser/background/background_mode_manager_win.cc b/chrome/browser/background/background_mode_manager_win.cc index b07fee2..669fb6a 100644 --- a/chrome/browser/background/background_mode_manager_win.cc +++ b/chrome/browser/background/background_mode_manager_win.cc @@ -22,7 +22,7 @@ using content::BrowserThread; void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { // This functionality is only defined for default profile, currently. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir)) return; BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, diff --git a/chrome/browser/bookmarks/bookmark_model_factory.cc b/chrome/browser/bookmarks/bookmark_model_factory.cc index d20e52f..b0f61ee 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/chrome/browser/bookmarks/bookmark_model_factory.cc @@ -70,7 +70,7 @@ KeyedService* BookmarkModelFactory::BuildServiceInstanceFor( bool register_bookmark_undo_service_as_observer = true; #if !defined(OS_IOS) && !defined(OS_ANDROID) register_bookmark_undo_service_as_observer = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableBookmarkUndo); #endif // !defined(OS_IOS) if (register_bookmark_undo_service_as_observer) { diff --git a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc index f441a62..1992640 100644 --- a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc +++ b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc @@ -87,7 +87,7 @@ void UpdateBookmarksExperimentState( // kEnhancedBookmarksExperiment flag could have values "", "1" and "0". // "0" - user opted out. - bool opt_out = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + bool opt_out = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kEnhancedBookmarksExperiment) == "0"; BookmarksExperimentState bookmarks_experiment_new_state = @@ -135,9 +135,9 @@ void UpdateBookmarksExperimentState( } #if defined(OS_ANDROID) - bool opt_in = !opt_out - && CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kEnhancedBookmarksExperiment) == "1"; + bool opt_in = !opt_out && + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kEnhancedBookmarksExperiment) == "1"; if (opt_in && bookmarks_experiment_new_state == BOOKMARKS_EXPERIMENT_NONE) bookmarks_experiment_new_state = BOOKMARKS_EXPERIMENT_ENABLED; #endif @@ -202,7 +202,7 @@ bool IsEnhancedBookmarksExperimentEnabled( if (flags.find(switches::kManualEnhancedBookmarksOptout) != flags.end()) return true; #else - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { return true; @@ -237,8 +237,8 @@ bool IsEnhancedBookmarksEnabled(const PrefService* user_prefs) { #endif bool IsEnableDomDistillerSet() { - if (CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableDomDistiller)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableDomDistiller)) { return true; } if (variations::GetVariationParamValue( @@ -249,8 +249,8 @@ bool IsEnableDomDistillerSet() { } bool IsEnableSyncArticlesSet() { - if (CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableSyncArticles)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableSyncArticles)) { return true; } if (variations::GetVariationParamValue( diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index deb6202..fa4bc86 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -165,7 +165,7 @@ using content::ResourceDispatcherHost; BrowserProcessImpl::BrowserProcessImpl( base::SequencedTaskRunner* local_state_task_runner, - const CommandLine& command_line) + const base::CommandLine& command_line) : created_watchdog_thread_(false), created_browser_policy_connector_(false), created_profile_manager_(false), @@ -865,7 +865,7 @@ BrowserProcessImpl::component_updater() { return NULL; component_updater::Configurator* configurator = component_updater::MakeChromeComponentUpdaterConfigurator( - CommandLine::ForCurrentProcess(), + base::CommandLine::ForCurrentProcess(), io_thread()->system_url_request_context_getter()); // Creating the component updater does not do anything, components // need to be registered and Start() needs to be called. @@ -1002,7 +1002,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { #if defined(OS_POSIX) // Also find plugins in a user-specific plugins dir, // e.g. ~/.config/chromium/Plugins. - const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess(); if (!cmd_line.HasSwitch(switches::kDisablePluginsDiscovery)) { base::FilePath user_data_dir; if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) @@ -1020,7 +1020,8 @@ void BrowserProcessImpl::PreMainMessageLoopRun() { #endif #endif // defined(ENABLE_PLUGINS) - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kDisableWebResources)) { DCHECK(!promo_resource_service_.get()); promo_resource_service_ = new PromoResourceService; @@ -1059,7 +1060,7 @@ void BrowserProcessImpl::CreateBackgroundModeManager() { #if defined(ENABLE_BACKGROUND) DCHECK(background_mode_manager_.get() == NULL); background_mode_manager_.reset( - new BackgroundModeManager(CommandLine::ForCurrentProcess(), + new BackgroundModeManager(base::CommandLine::ForCurrentProcess(), &profile_manager()->GetProfileInfoCache())); #endif } @@ -1163,19 +1164,21 @@ const char* const kSwitchesToAddOnAutorestart[] = { }; void BrowserProcessImpl::RestartBackgroundInstance() { - CommandLine* old_cl = CommandLine::ForCurrentProcess(); - scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram())); + base::CommandLine* old_cl = base::CommandLine::ForCurrentProcess(); + scoped_ptr<base::CommandLine> new_cl( + new base::CommandLine(old_cl->GetProgram())); - std::map<std::string, CommandLine::StringType> switches = + std::map<std::string, base::CommandLine::StringType> switches = old_cl->GetSwitches(); switches::RemoveSwitchesForAutostart(&switches); // Append the rest of the switches (along with their values, if any) // to the new command line - for (std::map<std::string, CommandLine::StringType>::const_iterator i = - switches.begin(); i != switches.end(); ++i) { - CommandLine::StringType switch_value = i->second; + for (std::map<std::string, base::CommandLine::StringType>::const_iterator i = + switches.begin(); + i != switches.end(); ++i) { + base::CommandLine::StringType switch_value = i->second; if (switch_value.length() > 0) { new_cl->AppendSwitchNative(i->first, i->second); } else { diff --git a/chrome/browser/browser_process_platform_part_aurawin.cc b/chrome/browser/browser_process_platform_part_aurawin.cc index 0298775..ecbe6f1 100644 --- a/chrome/browser/browser_process_platform_part_aurawin.cc +++ b/chrome/browser/browser_process_platform_part_aurawin.cc @@ -38,7 +38,7 @@ void BrowserProcessPlatformPart::OnMetroViewerProcessTerminated() { } void BrowserProcessPlatformPart::PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) { + const base::CommandLine& command_line) { // Check for Windows 8 specific commandlines requesting that this process // either connect to an existing viewer or launch a new viewer and // synchronously wait for it to connect. diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 27ec4de..20b6da6 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -223,17 +223,20 @@ void ShutdownPostThreadsStop(bool restart_last_session) { // which prevents us from appending to the command line directly (issue // 46182). We therefore use GetSwitches to copy the command line (it stops // at the switch argument terminator). - CommandLine old_cl(*CommandLine::ForCurrentProcess()); - scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl.GetProgram())); - std::map<std::string, CommandLine::StringType> switches = + base::CommandLine old_cl(*base::CommandLine::ForCurrentProcess()); + scoped_ptr<base::CommandLine> new_cl( + new base::CommandLine(old_cl.GetProgram())); + std::map<std::string, base::CommandLine::StringType> switches = old_cl.GetSwitches(); // Remove the switches that shouldn't persist across restart. about_flags::RemoveFlagsSwitches(&switches); switches::RemoveSwitchesForAutostart(&switches); // Append the old switches to the new command line. - for (std::map<std::string, CommandLine::StringType>::const_iterator i = - switches.begin(); i != switches.end(); ++i) { - CommandLine::StringType switch_value = i->second; + for ( + std::map<std::string, base::CommandLine::StringType>::const_iterator i = + switches.begin(); + i != switches.end(); ++i) { + base::CommandLine::StringType switch_value = i->second; if (!switch_value.empty()) new_cl->AppendSwitchNative(i->first, i->second); else diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc index f6042c4..738a17f 100644 --- a/chrome/browser/chrome_browser_field_trials.cc +++ b/chrome/browser/chrome_browser_field_trials.cc @@ -24,7 +24,7 @@ #endif ChromeBrowserFieldTrials::ChromeBrowserFieldTrials( - const CommandLine& parsed_command_line) + const base::CommandLine& parsed_command_line) : parsed_command_line_(parsed_command_line) { } diff --git a/chrome/browser/chrome_browser_field_trials_desktop.cc b/chrome/browser/chrome_browser_field_trials_desktop.cc index be94eec..9f3c516 100644 --- a/chrome/browser/chrome_browser_field_trials_desktop.cc +++ b/chrome/browser/chrome_browser_field_trials_desktop.cc @@ -65,7 +65,7 @@ void DisableShowProfileSwitcherTrialIfNecessary() { } // namespace -void SetupDesktopFieldTrials(const CommandLine& parsed_command_line, +void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line, PrefService* local_state) { prerender::ConfigurePrerender(parsed_command_line); AutoLaunchChromeFieldTrial(); diff --git a/chrome/browser/chrome_browser_field_trials_mobile.cc b/chrome/browser/chrome_browser_field_trials_mobile.cc index 97d0135..a3caf4f 100644 --- a/chrome/browser/chrome_browser_field_trials_mobile.cc +++ b/chrome/browser/chrome_browser_field_trials_mobile.cc @@ -64,7 +64,7 @@ void SetupDataCompressionProxyFieldTrials() { } // namespace -void SetupMobileFieldTrials(const CommandLine& parsed_command_line) { +void SetupMobileFieldTrials(const base::CommandLine& parsed_command_line) { SetupDataCompressionProxyFieldTrials(); #if defined(OS_ANDROID) prerender::ConfigurePrerender(parsed_command_line); diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 3f83021..cab921c 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -222,7 +222,7 @@ namespace { // This function provides some ways to test crash and assertion handling // behavior of the program. -void HandleTestParameters(const CommandLine& command_line) { +void HandleTestParameters(const base::CommandLine& command_line) { // This parameter causes an assertion. if (command_line.HasSwitch(switches::kBrowserAssertTest)) { DCHECK(false); @@ -250,7 +250,7 @@ void AddFirstRunNewTabs(StartupBrowserCreator* browser_creator, // |local_state_task_runner| must be a shutdown-blocking task runner. PrefService* InitializeLocalState( base::SequencedTaskRunner* local_state_task_runner, - const CommandLine& parsed_command_line) { + const base::CommandLine& parsed_command_line) { TRACE_EVENT0("startup", "ChromeBrowserMainParts::InitializeLocalState") base::FilePath local_state_path; PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); @@ -327,7 +327,7 @@ PrefService* InitializeLocalState( // should not continue. Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters, const base::FilePath& user_data_dir, - const CommandLine& parsed_command_line) { + const base::CommandLine& parsed_command_line) { TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile") base::Time start = base::Time::Now(); if (profiles::IsMultipleProfilesEnabled() && @@ -455,7 +455,7 @@ void RegisterComponentsForUpdate() { #if !defined(OS_ANDROID) bool ProcessSingletonNotificationCallback( - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& current_directory) { // Drop the request if the browser process is already in shutdown path. if (!g_browser_process || g_browser_process->IsShuttingDown()) @@ -492,7 +492,7 @@ bool ProcessSingletonNotificationCallback( } #endif // !defined(OS_ANDROID) -void LaunchDevToolsHandlerIfNeeded(const CommandLine& command_line) { +void LaunchDevToolsHandlerIfNeeded(const base::CommandLine& command_line) { if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) { std::string port_str = command_line.GetSwitchValueASCII(::switches::kRemoteDebuggingPort); @@ -600,7 +600,8 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { field_trial_list_.reset( new base::FieldTrialList(metrics->CreateEntropyProvider().release())); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnableBenchmarking) || command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { base::FieldTrial::EnableBenchmarking(); @@ -875,17 +876,18 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { about_flags::PrefServiceFlagsStorage flags_storage_( g_browser_process->local_state()); about_flags::ConvertFlagsToSwitches(&flags_storage_, - CommandLine::ForCurrentProcess(), + base::CommandLine::ForCurrentProcess(), about_flags::kAddSentinels); } #endif local_state_->UpdateCommandLinePrefStore( - new CommandLinePrefStore(CommandLine::ForCurrentProcess())); + new CommandLinePrefStore(base::CommandLine::ForCurrentProcess())); // Reset the command line in the crash report details, since we may have // just changed it to include experiments. - crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); + crash_keys::SetSwitchesFromCommandLine( + base::CommandLine::ForCurrentProcess()); // Mac starts it earlier in |PreMainMessageLoopStart()| (because it is // needed when loading the MainMenu.nib and the language doesn't depend on diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc index a39f51f..011e4de 100644 --- a/chrome/browser/chrome_browser_main_android.cc +++ b/chrome/browser/chrome_browser_main_android.cc @@ -42,8 +42,8 @@ void ChromeBrowserMainPartsAndroid::PreProfileInit() { // Allow Breakpad to be enabled in Chromium builds for testing purposes. if (!breakpad_enabled) - breakpad_enabled = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableCrashReporterForTesting); + breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableCrashReporterForTesting); if (breakpad_enabled) { base::FilePath crash_dump_dir; diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index bfbe7ea..2dc68c8 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -165,10 +165,12 @@ void ChromeBrowserMainPartsMac::PreEarlyInitialization() { ChromeBrowserMainPartsPosix::PreEarlyInitialization(); if (base::mac::WasLaunchedAsLoginItemRestoreState()) { - CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* singleton_command_line = + base::CommandLine::ForCurrentProcess(); singleton_command_line->AppendSwitch(switches::kRestoreLastSession); } else if (base::mac::WasLaunchedAsHiddenLoginItem()) { - CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* singleton_command_line = + base::CommandLine::ForCurrentProcess(); singleton_command_line->AppendSwitch(switches::kNoStartupWindow); } diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 946d178..e7b9e8c 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -181,10 +181,10 @@ ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( if (metro_switches_proc) { base::string16 metro_switches = (*metro_switches_proc)(); if (!metro_switches.empty()) { - CommandLine extra_switches(CommandLine::NO_PROGRAM); + base::CommandLine extra_switches(base::CommandLine::NO_PROGRAM); extra_switches.ParseFromString(metro_switches); - CommandLine::ForCurrentProcess()->AppendArguments(extra_switches, - false); + base::CommandLine::ForCurrentProcess()->AppendArguments(extra_switches, + false); } } } @@ -239,7 +239,7 @@ int ChromeBrowserMainPartsWin::PreCreateThreads() { // Revisit this when the pdf plugin uses skia and stops using GDI. if (switches::IsWin32kRendererLockdownEnabled() && base::win::GetVersion() >= base::win::VERSION_WIN8) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableOutOfProcessPdf); } return rv; @@ -298,7 +298,7 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() { // static void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( - const CommandLine& parsed_command_line) { + const base::CommandLine& parsed_command_line) { // Clear this var so child processes don't show the dialog by default. scoped_ptr<base::Environment> env(base::Environment::Create()); env->UnSetVar(env_vars::kShowRestart); @@ -332,7 +332,7 @@ void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( // static void ChromeBrowserMainPartsWin::RegisterApplicationRestart( - const CommandLine& parsed_command_line) { + const base::CommandLine& parsed_command_line) { DCHECK(base::win::GetVersion() >= base::win::VERSION_VISTA); base::ScopedNativeLibrary library(base::FilePath(L"kernel32.dll")); // Get the function pointer for RegisterApplicationRestart. @@ -345,7 +345,7 @@ void ChromeBrowserMainPartsWin::RegisterApplicationRestart( } // The Windows Restart Manager expects a string of command line flags only, // without the program. - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendArguments(parsed_command_line, false); if (!command_line.HasSwitch(switches::kRestoreLastSession)) command_line.AppendSwitch(switches::kRestoreLastSession); @@ -367,7 +367,7 @@ void ChromeBrowserMainPartsWin::RegisterApplicationRestart( // static int ChromeBrowserMainPartsWin::HandleIconsCommands( - const CommandLine& parsed_command_line) { + const base::CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(switches::kHideIcons)) { base::string16 cp_applet; base::win::Version version = base::win::GetVersion(); @@ -418,7 +418,7 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; ui::MessageBox(NULL, text, caption, flags); } - CommandLine uninstall_cmd( + base::CommandLine uninstall_cmd( InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); if (!uninstall_cmd.GetProgram().empty()) { uninstall_cmd.AppendSwitch(installer::switches::kSelfDestruct); diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index fb888fa..c034e41 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -454,7 +454,7 @@ breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( } } -int GetCrashSignalFD(const CommandLine& command_line) { +int GetCrashSignalFD(const base::CommandLine& command_line) { // Extensions have the same process type as renderers. if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) { static breakpad::CrashHandlerHostLinux* crash_handler = NULL; @@ -1197,7 +1197,8 @@ bool IsAutoReloadEnabled() { // manually enable or disable auto-reload. std::string group = base::FieldTrialList::FindFullName( "AutoReloadExperiment"); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kEnableOfflineAutoReload)) return true; if (browser_command_line.HasSwitch(switches::kDisableOfflineAutoReload)) @@ -1209,7 +1210,8 @@ bool IsAutoReloadVisibleOnlyEnabled() { // See the block comment in IsAutoReloadEnabled(). std::string group = base::FieldTrialList::FindFullName( "AutoReloadVisibleOnlyExperiment"); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch( switches::kEnableOfflineAutoReloadVisibleOnly)) { return true; @@ -1224,7 +1226,8 @@ bool IsAutoReloadVisibleOnlyEnabled() { } // namespace void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( - CommandLine* command_line, int child_process_id) { + base::CommandLine* command_line, + int child_process_id) { #if defined(OS_POSIX) if (breakpad::IsCrashReporterEnabled()) { scoped_ptr<metrics::ClientInfo> client_info = @@ -1240,7 +1243,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); static const char* const kCommonSwitchNames[] = { switches::kUserAgent, @@ -2130,8 +2134,9 @@ bool ChromeContentBrowserClient::CanCreateWindow( render_process_id, opener_id); - if (!user_gesture && !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisablePopupBlocking)) { + if (!user_gesture && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisablePopupBlocking)) { if (content_settings->GetContentSetting(opener_top_level_frame_url, opener_top_level_frame_url, CONTENT_SETTINGS_TYPE_POPUPS, @@ -2432,7 +2437,7 @@ void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( #if defined(OS_POSIX) && !defined(OS_MACOSX) void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, FileDescriptorInfo* mappings) { #if defined(OS_ANDROID) @@ -2603,8 +2608,8 @@ ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess( #if defined(ENABLE_WEBRTC) void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch( - CommandLine* to_command_line, - const CommandLine& from_command_line, + base::CommandLine* to_command_line, + const base::CommandLine& from_command_line, VersionInfo::Channel channel) { #if defined(OS_ANDROID) const VersionInfo::Channel kMaxDisableEncryptionChannel = diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc index 09c10b4..8fa8043 100644 --- a/chrome/browser/chrome_content_browser_client_browsertest.cc +++ b/chrome/browser/chrome_content_browser_client_browsertest.cc @@ -87,7 +87,7 @@ IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest, // such as http://crbug.com/164223. IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest, SitePerProcessNavigation) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kSitePerProcess); ASSERT_TRUE(test_server()->Start()); const GURL url(test_server()->GetURL("files/title1.html")); diff --git a/chrome/browser/chrome_content_browser_client_unittest.cc b/chrome/browser/chrome_content_browser_client_unittest.cc index 9d9dbeb..32ed674 100644 --- a/chrome/browser/chrome_content_browser_client_unittest.cc +++ b/chrome/browser/chrome_content_browser_client_unittest.cc @@ -36,8 +36,8 @@ TEST_F(ChromeContentBrowserClientTest, ShouldAssignSiteForURL) { class DisableWebRtcEncryptionFlagTest : public testing::Test { public: DisableWebRtcEncryptionFlagTest() - : from_command_line_(CommandLine::NO_PROGRAM), - to_command_line_(CommandLine::NO_PROGRAM) {} + : from_command_line_(base::CommandLine::NO_PROGRAM), + to_command_line_(base::CommandLine::NO_PROGRAM) {} protected: void SetUp() override { @@ -51,8 +51,8 @@ class DisableWebRtcEncryptionFlagTest : public testing::Test { channel); } - CommandLine from_command_line_; - CommandLine to_command_line_; + base::CommandLine from_command_line_; + base::CommandLine to_command_line_; DISALLOW_COPY_AND_ASSIGN(DisableWebRtcEncryptionFlagTest); }; diff --git a/chrome/browser/chrome_main_browsertest.cc b/chrome/browser/chrome_main_browsertest.cc index c6321ad..c2f951f 100644 --- a/chrome/browser/chrome_main_browsertest.cc +++ b/chrome/browser/chrome_main_browsertest.cc @@ -28,7 +28,7 @@ class ChromeMainTest : public InProcessBrowserTest { public: ChromeMainTest() {} - void Relaunch(const CommandLine& new_command_line) { + void Relaunch(const base::CommandLine& new_command_line) { base::LaunchProcess(new_command_line, base::LaunchOptionsForTest(), NULL); } }; @@ -37,7 +37,8 @@ class ChromeMainTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunch) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -51,13 +52,14 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunch) { IN_PROC_BROWSER_TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif base::FilePath test_file_path = ui_test_utils::GetTestFilePath( base::FilePath(), base::FilePath().AppendASCII("empty.html")); - CommandLine new_command_line(GetCommandLineForRelaunch()); + base::CommandLine new_command_line(GetCommandLineForRelaunch()); new_command_line.AppendArgPath(test_file_path); content::WindowedNotificationObserver observer( chrome::NOTIFICATION_TAB_ADDED, @@ -87,7 +89,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, MAYBE_SecondLaunchWithIncognitoUrl) { // Run with --incognito switch and an URL specified. base::FilePath test_file_path = ui_test_utils::GetTestFilePath( base::FilePath(), base::FilePath().AppendASCII("empty.html")); - CommandLine new_command_line(GetCommandLineForRelaunch()); + base::CommandLine new_command_line(GetCommandLineForRelaunch()); new_command_line.AppendSwitch(switches::kIncognito); new_command_line.AppendArgPath(test_file_path); @@ -106,7 +108,8 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, MAYBE_SecondLaunchWithIncognitoUrl) { IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -137,7 +140,7 @@ IN_PROC_BROWSER_TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { // Run with just an URL specified, no --incognito switch. base::FilePath test_file_path = ui_test_utils::GetTestFilePath( base::FilePath(), base::FilePath().AppendASCII("empty.html")); - CommandLine new_command_line(GetCommandLineForRelaunch()); + base::CommandLine new_command_line(GetCommandLineForRelaunch()); new_command_line.AppendArgPath(test_file_path); content::WindowedNotificationObserver tab_observer( chrome::NOTIFICATION_TAB_ADDED, diff --git a/chrome/browser/chrome_net_benchmarking_message_filter.cc b/chrome/browser/chrome_net_benchmarking_message_filter.cc index c3d5404..d601beb 100644 --- a/chrome/browser/chrome_net_benchmarking_message_filter.cc +++ b/chrome/browser/chrome_net_benchmarking_message_filter.cc @@ -141,7 +141,8 @@ bool ChromeNetBenchmarkingMessageFilter::CheckBenchmarkingEnabled() const { static bool checked = false; static bool result = false; if (!checked) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); result = command_line.HasSwitch(switches::kEnableNetBenchmarking); checked = true; } diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc index 5824824..52efec5 100644 --- a/chrome/browser/chrome_process_finder_win.cc +++ b/chrome/browser/chrome_process_finder_win.cc @@ -151,7 +151,7 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, } #endif - CommandLine command_line(*CommandLine::ForCurrentProcess()); + base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); command_line.AppendSwitchASCII( switches::kOriginalProcessStartTime, base::Int64ToString( diff --git a/chrome/browser/chrome_process_singleton_win_unittest.cc b/chrome/browser/chrome_process_singleton_win_unittest.cc index e9d9759..d56d7a5 100644 --- a/chrome/browser/chrome_process_singleton_win_unittest.cc +++ b/chrome/browser/chrome_process_singleton_win_unittest.cc @@ -14,13 +14,13 @@ namespace { bool ServerCallback(int* callback_count, - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& current_directory) { ++(*callback_count); return true; } -bool ClientCallback(const CommandLine& command_line, +bool ClientCallback(const base::CommandLine& command_line, const base::FilePath& current_directory) { ADD_FAILURE(); return false; diff --git a/chrome/browser/chrome_security_exploit_browsertest.cc b/chrome/browser/chrome_security_exploit_browsertest.cc index c294775..4486a02 100644 --- a/chrome/browser/chrome_security_exploit_browsertest.cc +++ b/chrome/browser/chrome_security_exploit_browsertest.cc @@ -30,7 +30,7 @@ class ChromeSecurityExploitBrowserTest : public InProcessBrowserTest { ChromeSecurityExploitBrowserTest() {} ~ChromeSecurityExploitBrowserTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ASSERT_TRUE(test_server()->Start()); net::SpawnedTestServer https_server( net::SpawnedTestServer::TYPE_HTTPS, diff --git a/chrome/browser/chrome_switches_browsertest.cc b/chrome/browser/chrome_switches_browsertest.cc index 7764138..c936004 100644 --- a/chrome/browser/chrome_switches_browsertest.cc +++ b/chrome/browser/chrome_switches_browsertest.cc @@ -16,7 +16,7 @@ class HostRulesTest : public InProcessBrowserTest { protected: HostRulesTest() {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ASSERT_TRUE(test_server()->Start()); // Map all hosts to our local server. diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc index 80a62ec53..172b0f7 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc @@ -226,7 +226,7 @@ class AccessibilityManagerTest : public InProcessBrowserTest { AccessibilityManagerTest() : default_autoclick_delay_(0) {} virtual ~AccessibilityManagerTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, TestingProfile::kTestUserProfileDir); diff --git a/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc index 12ef7e6..242ace5 100644 --- a/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc @@ -96,7 +96,7 @@ class MagnificationControllerTest : public InProcessBrowserTest { MagnificationControllerTest() {} ~MagnificationControllerTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); // Make screens sufficiently wide to host 2 browsers side by side. command_line->AppendSwitchASCII("ash-host-window-bounds", "1200x800"); diff --git a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc index 2bef6d6..370d064 100644 --- a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc @@ -152,7 +152,7 @@ class MagnificationManagerTest : public InProcessBrowserTest { MagnificationManagerTest() {} virtual ~MagnificationManagerTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitchASCII(switches::kLoginProfile, TestingProfile::kTestUserProfileDir); diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc index 8f074c5..bc9ec36 100644 --- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc @@ -238,7 +238,7 @@ class SpokenFeedbackTest SpokenFeedbackTest() {} virtual ~SpokenFeedbackTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { if (GetParam() == kTestAsGuestUser) { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); @@ -528,7 +528,7 @@ class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { GuestSpokenFeedbackTest() {} virtual ~GuestSpokenFeedbackTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); @@ -559,7 +559,7 @@ class OobeSpokenFeedbackTest : public InProcessBrowserTest { OobeSpokenFeedbackTest() {} virtual ~OobeSpokenFeedbackTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); diff --git a/chrome/browser/chromeos/app_mode/fake_cws.cc b/chrome/browser/chromeos/app_mode/fake_cws.cc index 4b0120f..f4f343d 100644 --- a/chrome/browser/chromeos/app_mode/fake_cws.cc +++ b/chrome/browser/chromeos/app_mode/fake_cws.cc @@ -113,7 +113,7 @@ void FakeCWS::SetupWebStoreURL(const GURL& test_server_url) { void FakeCWS::OverrideGalleryCommandlineSwitches() { DCHECK(web_store_url_.is_valid()); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII( ::switches::kAppsGalleryURL, diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc index 16999e3..6eb63e4 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc @@ -185,7 +185,7 @@ class KioskAppManagerTest : public InProcessBrowserTest { InProcessBrowserTest::SetUp(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); // Initialize fake_cws_ to setup web store gallery. diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_app_update_service_browsertest.cc index a0b20b5..4e66213 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service_browsertest.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service_browsertest.cc @@ -87,7 +87,7 @@ class KioskAppUpdateServiceTest test_data_dir_.AppendASCII("api_test/runtime/on_restart_required")); // Fake app mode command line. - CommandLine* command = CommandLine::ForCurrentProcess(); + base::CommandLine* command = base::CommandLine::ForCurrentProcess(); command->AppendSwitch(switches::kForceAppMode); command->AppendSwitchASCII(switches::kAppId, app_->id()); diff --git a/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc b/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc index 651d227..7d9fe0f 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc @@ -74,7 +74,7 @@ void KioskModeIdleAppNameNotification::Setup() { void KioskModeIdleAppNameNotification::OnUserActivity(const ui::Event* event) { if (show_notification_upon_next_user_activity_) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); const std::string app_id = command_line->GetSwitchValueASCII(::switches::kAppId); Profile* profile = ProfileManager::GetActiveUserProfile(); diff --git a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc index b551e7c..0ddc96a 100644 --- a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc +++ b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc @@ -26,10 +26,11 @@ namespace { bool IsNormalWallpaperChange() { if (chromeos::LoginState::Get()->IsUserLoggedIn() || - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kFirstExecAfterBoot) || WizardController::IsZeroDelayEnabled() || - !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) { + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kLoginManager)) { return true; } @@ -68,7 +69,8 @@ class UserWallpaperDelegate : public ash::UserWallpaperDelegate { // It is a first boot case now. If kDisableBootAnimation flag // is passed, it only disables any transition after OOBE. bool is_registered = StartupUtils::IsDeviceRegistered(); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); bool disable_boot_animation = command_line-> HasSwitch(switches::kDisableBootAnimation); if (is_registered && disable_boot_animation) diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 09e4bcf..8867918 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -276,7 +276,8 @@ ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { - CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* singleton_command_line = + base::CommandLine::ForCurrentProcess(); if (parsed_command_line().HasSwitch(switches::kGuestSession)) { // Disable sync and extensions if we're in "browse without sign-in" mode. @@ -594,7 +595,8 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { renderer_freezer_.reset( new RendererFreezer(scoped_ptr<RendererFreezer::Delegate>( new FreezerCgroupProcessManager()))); - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kWakeOnPackets)) light_bar_.reset(new LightBar()); g_browser_process->platform_part()->InitializeAutomaticRebootManager(); @@ -644,7 +646,7 @@ void ChromeBrowserMainPartsChromeos::PreBrowserStart() { g_browser_process->platform_part()->oom_priority_manager()->Start(); if (ui::ShouldDefaultToNaturalScroll()) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( chromeos::switches::kNaturalScrollDefault); system::InputDeviceSettings::Get()->SetTapToClick(true); } diff --git a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc index 022863d..a9cc4a7 100644 --- a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc +++ b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc @@ -231,7 +231,7 @@ class CustomizationWallpaperDownloaderBrowserTest local_state_ = g_browser_process->local_state(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); } diff --git a/chrome/browser/chromeos/drive/drive_notification_manager_factory_browsertest.cc b/chrome/browser/chromeos/drive/drive_notification_manager_factory_browsertest.cc index b627c75..ac14142 100644 --- a/chrome/browser/chromeos/drive/drive_notification_manager_factory_browsertest.cc +++ b/chrome/browser/chromeos/drive/drive_notification_manager_factory_browsertest.cc @@ -20,7 +20,7 @@ namespace drive { class DriveNotificationManagerFactoryLoginScreenBrowserTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); } @@ -39,7 +39,7 @@ IN_PROC_BROWSER_TEST_F(DriveNotificationManagerFactoryLoginScreenBrowserTest, class DriveNotificationManagerFactoryGuestBrowserTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); diff --git a/chrome/browser/chromeos/events/event_rewriter.cc b/chrome/browser/chromeos/events/event_rewriter.cc index 75d97c4..eb7dfc3 100644 --- a/chrome/browser/chromeos/events/event_rewriter.cc +++ b/chrome/browser/chromeos/events/event_rewriter.cc @@ -103,7 +103,7 @@ const ModifierRemapping* GetRemappedKey(const std::string& pref_name, } bool HasDiamondKey() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kHasChromeOSDiamondKey); } diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc index 4f6609d..9084875 100644 --- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc +++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc @@ -522,12 +522,12 @@ TEST_F(EventRewriterTest, TestRewriteNumPadKeys) { TEST_F(EventRewriterTest, TestRewriteNumPadKeysWithDiamondKeyFlag) { // Make sure the num lock works correctly even when Diamond key exists. - const CommandLine original_cl(*CommandLine::ForCurrentProcess()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + const base::CommandLine original_cl(*base::CommandLine::ForCurrentProcess()); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( chromeos::switches::kHasChromeOSDiamondKey, ""); TestRewriteNumPadKeys(); - *CommandLine::ForCurrentProcess() = original_cl; + *base::CommandLine::ForCurrentProcess() = original_cl; } // Tests if the rewriter can handle a Command + Num Pad event. @@ -566,12 +566,12 @@ TEST_F(EventRewriterTest, TestRewriteNumPadKeysOnAppleKeyboard) { TEST_F(EventRewriterTest, TestRewriteNumPadKeysOnAppleKeyboardWithDiamondKeyFlag) { // Makes sure the num lock works correctly even when Diamond key exists. - const CommandLine original_cl(*CommandLine::ForCurrentProcess()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + const base::CommandLine original_cl(*base::CommandLine::ForCurrentProcess()); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( chromeos::switches::kHasChromeOSDiamondKey, ""); TestRewriteNumPadKeysOnAppleKeyboard(); - *CommandLine::ForCurrentProcess() = original_cl; + *base::CommandLine::ForCurrentProcess() = original_cl; } TEST_F(EventRewriterTest, TestRewriteModifiersNoRemap) { @@ -1050,8 +1050,8 @@ TEST_F(EventRewriterTest, TestRewriteDiamondKey) { } TEST_F(EventRewriterTest, TestRewriteDiamondKeyWithFlag) { - const CommandLine original_cl(*CommandLine::ForCurrentProcess()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + const base::CommandLine original_cl(*base::CommandLine::ForCurrentProcess()); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( chromeos::switches::kHasChromeOSDiamondKey, ""); TestingPrefServiceSyncable prefs; @@ -1166,7 +1166,7 @@ TEST_F(EventRewriterTest, TestRewriteDiamondKeyWithFlag) { GetRewrittenEventAsString( &rewriter, ui::VKEY_A, ui::EF_NONE, ui::ET_KEY_PRESSED)); - *CommandLine::ForCurrentProcess() = original_cl; + *base::CommandLine::ForCurrentProcess() = original_cl; } TEST_F(EventRewriterTest, TestRewriteCapsLockToControl) { @@ -1664,7 +1664,7 @@ TEST_F(EventRewriterTest, TestRewriteFunctionKeys) { } TEST_F(EventRewriterTest, TestRewriteExtendedKeysWithSearchRemapped) { - const CommandLine original_cl(*CommandLine::ForCurrentProcess()); + const base::CommandLine original_cl(*base::CommandLine::ForCurrentProcess()); // Remap Search to Control. TestingPrefServiceSyncable prefs; @@ -1677,7 +1677,7 @@ TEST_F(EventRewriterTest, TestRewriteExtendedKeysWithSearchRemapped) { rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard"); rewriter.set_pref_service_for_testing(&prefs); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( chromeos::switches::kHasChromeOSKeyboard, ""); KeyTestCase tests[] = { @@ -1698,7 +1698,7 @@ TEST_F(EventRewriterTest, TestRewriteExtendedKeysWithSearchRemapped) { CheckKeyTestCase(&rewriter, tests[i]); } - *CommandLine::ForCurrentProcess() = original_cl; + *base::CommandLine::ForCurrentProcess() = original_cl; } TEST_F(EventRewriterTest, TestRewriteKeyEventSentByXSendEvent) { diff --git a/chrome/browser/chromeos/extensions/echo_private_apitest.cc b/chrome/browser/chromeos/extensions/echo_private_apitest.cc index dd37945..f3bcda6 100644 --- a/chrome/browser/chromeos/extensions/echo_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/echo_private_apitest.cc @@ -34,7 +34,7 @@ class ExtensionEchoPrivateApiTest : public ExtensionApiTest { virtual ~ExtensionEchoPrivateApiTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Force usage of stub cros settings provider instead of device settings diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc index 994d2b8..5ae07e4 100644 --- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc +++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc @@ -326,7 +326,7 @@ bool ShouldShowNotificationForVolume( // If the disable-default-apps flag is on, Files.app is not opened // automatically on device mount not to obstruct the manual test. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableDefaultApps)) { return false; } diff --git a/chrome/browser/chromeos/extensions/input_method_api.cc b/chrome/browser/chromeos/extensions/input_method_api.cc index 644da1d..15954ca 100644 --- a/chrome/browser/chromeos/extensions/input_method_api.cc +++ b/chrome/browser/chromeos/extensions/input_method_api.cc @@ -34,12 +34,11 @@ ExtensionFunction::ResponseAction GetInputMethodConfigFunction::Run() { base::DictionaryValue* output = new base::DictionaryValue(); output->SetBoolean( "isPhysicalKeyboardAutocorrectEnabled", - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kEnablePhysicalKeyboardAutocorrect)); - output->SetBoolean( - "isNewQPInputViewEnabled", - CommandLine::ForCurrentProcess()->HasSwitch( - chromeos::switches::kEnableNewQPInputView)); + output->SetBoolean("isNewQPInputViewEnabled", + base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kEnableNewQPInputView)); return RespondNow(OneArgument(output)); #endif } diff --git a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc index 71621c4..653883f 100644 --- a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc +++ b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc @@ -64,7 +64,7 @@ class TestListener : public content::NotificationObserver { }; class ExtensionInputMethodApiTest : public ExtensionApiTest { - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc b/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc index da1a481..a59c512 100644 --- a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc +++ b/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc @@ -55,7 +55,8 @@ VirtualKeyboardBrowserTestConfig::VirtualKeyboardBrowserTestConfig() VirtualKeyboardBrowserTestConfig::~VirtualKeyboardBrowserTestConfig() {}; -void VirtualKeyboardBrowserTest::SetUpCommandLine(CommandLine* command_line) { +void VirtualKeyboardBrowserTest::SetUpCommandLine( + base::CommandLine* command_line) { command_line->AppendSwitch(keyboard::switches::kEnableVirtualKeyboard); } diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index bae1088..564f044 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc @@ -62,7 +62,7 @@ const char kWallpaperManifestBaseURL[] = #endif bool IsOEMDefaultWallpaper() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDefaultWallpaperIsOem); } @@ -739,7 +739,7 @@ bool WallpaperPrivateGetThumbnailFunction::RunAsync() { // TODO(bshe): Small resolution wallpaper is used here as wallpaper // thumbnail. We should either resize it or include a wallpaper thumbnail in // addition to large and small wallpaper resolutions. - thumbnail_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( + thumbnail_path = base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( chromeos::switches::kDefaultWallpaperSmall); } diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc index 27af32e..0b52694 100644 --- a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc +++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc @@ -141,7 +141,7 @@ FileBrowserHandlerList FindFileBrowserHandlersForURL( "chrome-extension://*/*.zip"); if (handler->extension_id() == kFileManagerAppId && zip_pattern.MatchesURL(selected_file_url) && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDisableNewZIPUnpacker)) { continue; } diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index e1f50b7..08ce74e 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc @@ -539,7 +539,7 @@ class FileManagerBrowserTestBase : public ExtensionApiTest { virtual void SetUpOnMainThread() override; // Adds an incognito and guest-mode flags for tests in the guest mode. - virtual void SetUpCommandLine(CommandLine* command_line) override; + virtual void SetUpCommandLine(base::CommandLine* command_line) override; // Loads our testing extension and sends it a string identifying the current // test. @@ -603,7 +603,8 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() { net::NetworkChangeNotifier::SetTestNotificationsOnly(true); } -void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { +void FileManagerBrowserTestBase::SetUpCommandLine( + base::CommandLine* command_line) { if (GetGuestModeParam() == IN_GUEST_MODE) { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); @@ -1170,7 +1171,7 @@ static const TestAccountInfo kTestAccounts[] = { class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { protected: // Enables multi-profiles. - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { FileManagerBrowserTestBase::SetUpCommandLine(command_line); // Logs in to a dummy profile (For making MultiProfileWindowManager happy; // browser test creates a default window and the manager tries to assign a @@ -1500,7 +1501,7 @@ class VideoPlayerBrowserTestBase : public FileManagerBrowserTestBase { FileManagerBrowserTestBase::SetUp(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch( chromeos::switches::kEnableVideoPlayerChromecastSupport); FileManagerBrowserTestBase::SetUpCommandLine(command_line); diff --git a/chrome/browser/chromeos/file_manager/file_tasks.cc b/chrome/browser/chromeos/file_manager/file_tasks.cc index 54bcde5..4e8677b 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks.cc +++ b/chrome/browser/chromeos/file_manager/file_tasks.cc @@ -406,7 +406,7 @@ void FindFileHandlerTasks( // If the new ZIP unpacker is disabled, then hide its handlers, so we don't // show both the legacy one and the new one in Files app for ZIP files. if (extension->id() == extension_misc::kZIPUnpackerExtensionId && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDisableNewZIPUnpacker)) { continue; } diff --git a/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc b/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc index 7d8f39c..0e71d93 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc +++ b/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc @@ -405,8 +405,7 @@ TEST(FileManagerFileTasksTest, IsGenericFileHandler) { class FileManagerFileTasksComplexTest : public testing::Test { protected: FileManagerFileTasksComplexTest() - : command_line_(CommandLine::NO_PROGRAM), - extension_service_(NULL) { + : command_line_(base::CommandLine::NO_PROGRAM), extension_service_(NULL) { extensions::TestExtensionSystem* test_extension_system = static_cast<extensions::TestExtensionSystem*>( extensions::ExtensionSystem::Get(&test_profile_)); @@ -421,7 +420,7 @@ class FileManagerFileTasksComplexTest : public testing::Test { chromeos::ScopedTestCrosSettings test_cros_settings_; chromeos::ScopedTestUserManager test_user_manager_; TestingProfile test_profile_; - CommandLine command_line_; + base::CommandLine command_line_; ExtensionService* extension_service_; // Owned by test_profile_; }; diff --git a/chrome/browser/chromeos/file_manager/open_with_browser.cc b/chrome/browser/chromeos/file_manager/open_with_browser.cc index 1084fbd..974b34a 100644 --- a/chrome/browser/chromeos/file_manager/open_with_browser.cc +++ b/chrome/browser/chromeos/file_manager/open_with_browser.cc @@ -95,7 +95,7 @@ bool IsFlashPluginEnabled(Profile* profile) { DCHECK(profile); base::FilePath plugin_path( - CommandLine::ForCurrentProcess()->GetSwitchValueNative( + base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( switches::kPpapiFlashPath)); if (plugin_path.empty()) PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &plugin_path); diff --git a/chrome/browser/chromeos/first_run/first_run.cc b/chrome/browser/chromeos/first_run/first_run.cc index b4af283..ae47272 100644 --- a/chrome/browser/chromeos/first_run/first_run.cc +++ b/chrome/browser/chromeos/first_run/first_run.cc @@ -68,7 +68,7 @@ class DialogLauncher : public content::NotificationObserver { DCHECK(type == chrome::NOTIFICATION_SESSION_STARTED); DCHECK(content::Details<const user_manager::User>(details).ptr() == ProfileHelper::Get()->GetUserByProfile(profile_)); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool launched_in_test = command_line->HasSwitch(::switches::kTestType); bool launched_in_telemetry = command_line->HasSwitch(switches::kOobeSkipPostLogin); diff --git a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc index de0ffff..a9e7218 100644 --- a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc @@ -154,7 +154,8 @@ class CryptohomeAuthenticatorTest : public testing::Test { virtual ~CryptohomeAuthenticatorTest() {} virtual void SetUp() { - CommandLine::ForCurrentProcess()->AppendSwitch(switches::kLoginManager); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kLoginManager); mock_caller_ = new cryptohome::MockAsyncMethodCaller; cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_); diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index fe7a201..5c35b9f 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -66,9 +66,9 @@ const char kSwitchFormatString[] = " --%s=\"%s\""; // - Set start url if given; // - Append/override switches using |new_switches|; std::string DeriveCommandLine(const GURL& start_url, - const CommandLine& base_command_line, + const base::CommandLine& base_command_line, const base::DictionaryValue& new_switches, - CommandLine* command_line) { + base::CommandLine* command_line) { DCHECK_NE(&base_command_line, command_line); static const char* const kForwardSwitches[] = { @@ -343,8 +343,8 @@ void ChromeRestartRequest::RestartJob() { std::string GetOffTheRecordCommandLine( const GURL& start_url, bool is_oobe_completed, - const CommandLine& base_command_line, - CommandLine* command_line) { + const base::CommandLine& base_command_line, + base::CommandLine* command_line) { base::DictionaryValue otr_switches; otr_switches.SetString(switches::kGuestSession, std::string()); otr_switches.SetString(::switches::kIncognito, std::string()); diff --git a/chrome/browser/chromeos/login/crash_restore_browsertest.cc b/chrome/browser/chromeos/login/crash_restore_browsertest.cc index 04371a4..e3185a1 100644 --- a/chrome/browser/chromeos/login/crash_restore_browsertest.cc +++ b/chrome/browser/chromeos/login/crash_restore_browsertest.cc @@ -37,7 +37,7 @@ class CrashRestoreSimpleTest : public InProcessBrowserTest { virtual ~CrashRestoreSimpleTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kLoginUser, kUserId1); command_line->AppendSwitchASCII( switches::kLoginProfile, diff --git a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc index a4ec47f..d56a80b 100644 --- a/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc +++ b/chrome/browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc @@ -66,7 +66,7 @@ class DemoAppLauncherTest : public ExtensionBrowserTest { virtual ~DemoAppLauncherTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitch(switches::kForceLoginManagerInTests); command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc index 7259fe1..ad3dc0c 100644 --- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc @@ -28,7 +28,7 @@ const int kSafeguardTimeoutSeconds = 30; // Returns the int value of the |switch_name| argument, clamped to the [0, 62] // interval. Returns 0 if the argument doesn't exist or isn't an int value. int GetSanitizedArg(const std::string& switch_name) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switch_name)) return 0; std::string value = command_line->GetSwitchValueASCII(switch_name); @@ -72,7 +72,7 @@ const char AutoEnrollmentController::kForcedReEnrollmentOfficialBuild[] = "official"; AutoEnrollmentController::Mode AutoEnrollmentController::GetMode() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); std::string command_line_mode = command_line->GetSwitchValueASCII( switches::kEnterpriseEnableForcedReEnrollment); @@ -118,7 +118,7 @@ void AutoEnrollmentController::Start() { // also enables factories to start full guest sessions for testing, see // http://crbug.com/397354 for more context. - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(chromeos::switches::kDisableGaiaServices) || (!command_line->HasSwitch( chromeos::switches::kEnterpriseEnrollmentInitialModulus) && diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc b/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc index 56a52c8..1a43c8a 100644 --- a/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc @@ -89,7 +89,7 @@ class ProvisionedEnrollmentScreenTest : public EnrollmentScreenTest { private: // Overridden from InProcessBrowserTest: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { base::FilePath test_data_dir; ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( "app_mode", "kiosk_manifest", &test_data_dir)); diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index a72b71f..77a5d2f 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -132,9 +132,9 @@ void RecordPasswordLoginEvent(const UserContext& user_context) { bool CanShowDebuggingFeatures() { // We need to be on the login screen and in dev mode to show this menu item. - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kSystemDevMode) && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kLoginManager) && !user_manager::UserManager::Get()->IsSessionStarted(); } diff --git a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc index 1d25e03..275cc8e 100644 --- a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc @@ -158,7 +158,7 @@ class ExistingUserControllerTest : public policy::DevicePolicyCrosBrowserTest { .Times(1); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); } diff --git a/chrome/browser/chromeos/login/fake_login_utils.cc b/chrome/browser/chromeos/login/fake_login_utils.cc index e25740c..21df5b0 100644 --- a/chrome/browser/chromeos/login/fake_login_utils.cc +++ b/chrome/browser/chromeos/login/fake_login_utils.cc @@ -46,13 +46,9 @@ void FakeLoginUtils::DoBrowserLaunch(Profile* profile, chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; - ASSERT_TRUE( - browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), - profile, - base::FilePath(), - chrome::startup::IS_PROCESS_STARTUP, - first_run, - NULL)); + ASSERT_TRUE(browser_creator.LaunchBrowser( + *base::CommandLine::ForCurrentProcess(), profile, base::FilePath(), + chrome::startup::IS_PROCESS_STARTUP, first_run, NULL)); } if (login_host) login_host->Finalize(); diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index 1466064..b06cdf5 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -48,7 +48,7 @@ bool LoginScrollIntoViewEnabled() { // be centered when virtual keyboard shown, crbug.com/411879 return false; #else - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDisableLoginScrollIntoView); #endif } diff --git a/chrome/browser/chromeos/login/hwid_checker.cc b/chrome/browser/chromeos/login/hwid_checker.cc index 1877e2d..f04337c 100644 --- a/chrome/browser/chromeos/login/hwid_checker.cc +++ b/chrome/browser/chromeos/login/hwid_checker.cc @@ -112,7 +112,7 @@ bool IsMachineHWIDCorrect() { #if !defined(GOOGLE_CHROME_BUILD) return true; #endif - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(::switches::kTestType)) return true; if (!base::SysInfo::IsRunningOnChromeOS()) diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index fa8fb69..cb7d018 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc @@ -336,7 +336,7 @@ class KioskTest : public OobeBaseTest { KioskAppManager::Get()->CleanUp(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { OobeBaseTest::SetUpCommandLine(command_line); fake_cws_->Init(embedded_test_server()); } @@ -1774,7 +1774,7 @@ class KioskHiddenWebUITest : public KioskTest, KioskHiddenWebUITest() : wallpaper_loaded_(false) {} // KioskTest overrides: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { KioskTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kDisableBootAnimation); } diff --git a/chrome/browser/chromeos/login/lock/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/lock/screen_locker_browsertest.cc index cbc64ea..2970b7f 100644 --- a/chrome/browser/chromeos/login/lock/screen_locker_browsertest.cc +++ b/chrome/browser/chromeos/login/lock/screen_locker_browsertest.cc @@ -129,7 +129,7 @@ class ScreenLockerTest : public InProcessBrowserTest { ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); } diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc index dac8921..c7ef012 100644 --- a/chrome/browser/chromeos/login/login_browsertest.cc +++ b/chrome/browser/chromeos/login/login_browsertest.cc @@ -32,7 +32,7 @@ namespace { class LoginUserTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII( chromeos::switches::kLoginUser, "TestUser@gmail.com"); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, @@ -42,7 +42,7 @@ class LoginUserTest : public InProcessBrowserTest { class LoginGuestTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kGuestSession); command_line->AppendSwitch(::switches::kIncognito); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, @@ -54,14 +54,14 @@ class LoginGuestTest : public InProcessBrowserTest { class LoginCursorTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); } }; class LoginSigninTest : public InProcessBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); } diff --git a/chrome/browser/chromeos/login/login_manager_test.cc b/chrome/browser/chromeos/login/login_manager_test.cc index a83fe0d..add5d60 100644 --- a/chrome/browser/chromeos/login/login_manager_test.cc +++ b/chrome/browser/chromeos/login/login_manager_test.cc @@ -36,7 +36,7 @@ void LoginManagerTest::TearDownOnMainThread() { base::MessageLoop::current()->RunUntilIdle(); } -void LoginManagerTest::SetUpCommandLine(CommandLine* command_line) { +void LoginManagerTest::SetUpCommandLine(base::CommandLine* command_line) { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); MixinBasedBrowserTest::SetUpCommandLine(command_line); diff --git a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc index f155f6c..61bb940 100644 --- a/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc +++ b/chrome/browser/chromeos/login/login_screen_policy_browsertest.cc @@ -19,7 +19,7 @@ namespace em = enterprise_management; namespace chromeos { class LoginScreenPolicyTest : public policy::DevicePolicyCrosBrowserTest { - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); } diff --git a/chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc b/chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc index 903c0ca..a74c764 100644 --- a/chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc +++ b/chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc @@ -178,7 +178,7 @@ class LoginUIKeyboardTestWithUsersAndOwner : public chromeos::LoginManagerTest { LoginUIKeyboardTestWithUsersAndOwner() : LoginManagerTest(false) {} virtual ~LoginUIKeyboardTestWithUsersAndOwner() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { LoginManagerTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kStubCrosSettings); diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index a831430..36a6f2f 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -157,8 +157,8 @@ void LoginUtils::Set(LoginUtils* mock) { bool LoginUtils::IsWhitelisted(const std::string& username, bool* wildcard_match) { // Skip whitelist check for tests. - if (CommandLine::ForCurrentProcess()->HasSwitch( - chromeos::switches::kOobeSkipPostLogin)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kOobeSkipPostLogin)) { return true; } diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc index 077e87e..da5c7d8 100644 --- a/chrome/browser/chromeos/login/login_utils_browsertest.cc +++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc @@ -46,7 +46,7 @@ class LoginUtilsTest : public InProcessBrowserTest { public: LoginUtilsTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { // Initialize the test server early, so that we can use its base url for // the command line flags. ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); diff --git a/chrome/browser/chromeos/login/oobe_browsertest.cc b/chrome/browser/chromeos/login/oobe_browsertest.cc index 51a33ec..543a698 100644 --- a/chrome/browser/chromeos/login/oobe_browsertest.cc +++ b/chrome/browser/chromeos/login/oobe_browsertest.cc @@ -32,7 +32,7 @@ class OobeTest : public InProcessBrowserTest { OobeTest() {} virtual ~OobeTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); @@ -47,7 +47,7 @@ class OobeTest : public InProcessBrowserTest { base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); LOG(INFO) << "Set up http server at " << embedded_test_server()->base_url(); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( ::switches::kGaiaUrl, embedded_test_server()->base_url().spec()); } diff --git a/chrome/browser/chromeos/login/resource_loader_browsertest.cc b/chrome/browser/chromeos/login/resource_loader_browsertest.cc index f667db6..3041775 100644 --- a/chrome/browser/chromeos/login/resource_loader_browsertest.cc +++ b/chrome/browser/chromeos/login/resource_loader_browsertest.cc @@ -33,7 +33,7 @@ class ResourceLoaderBrowserTest : public InProcessBrowserTest { ResourceLoaderBrowserTest() {} protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { // Needed to load file:// URLs in XHRs. command_line->AppendSwitch(switches::kDisableWebSecurity); } diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc index e82f1d0..f28c1d7 100644 --- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc +++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc @@ -285,7 +285,7 @@ class SamlTest : public InProcessBrowserTest { host_resolver()->AddRule("*", "127.0.0.1"); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitch(switches::kForceLoginManagerInTests); command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); @@ -664,7 +664,7 @@ class SAMLEnrollmentTest : public SamlTest, // SamlTest: void SetUp() override; - void SetUpCommandLine(CommandLine* command_line) override; + void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) override; @@ -705,7 +705,7 @@ void SAMLEnrollmentTest::SetUp() { SamlTest::SetUp(); } -void SAMLEnrollmentTest::SetUpCommandLine(CommandLine* command_line) { +void SAMLEnrollmentTest::SetUpCommandLine(base::CommandLine* command_line) { command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, test_server_->GetServiceURL().spec()); command_line->AppendSwitch(policy::switches::kDisablePolicyKeyVerification); diff --git a/chrome/browser/chromeos/login/screens/error_screen.cc b/chrome/browser/chromeos/login/screens/error_screen.cc index a0a714e..14971c9 100644 --- a/chrome/browser/chromeos/login/screens/error_screen.cc +++ b/chrome/browser/chromeos/login/screens/error_screen.cc @@ -74,8 +74,9 @@ void ErrorScreen::OnAuthSuccess(const UserContext& user_context) { void ErrorScreen::OnOffTheRecordAuthSuccess() { // Restart Chrome to enter the guest session. - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine command_line(browser_command_line.GetProgram()); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine command_line(browser_command_line.GetProgram()); std::string cmd_line_str = GetOffTheRecordCommandLine(GURL(), StartupUtils::IsOobeCompleted(), diff --git a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc index d231527..df9427e 100644 --- a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc +++ b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc @@ -48,7 +48,7 @@ ScreenshotTester::Result::~Result() { } bool ScreenshotTester::TryInitialize() { - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableScreenshotTestingWithMode)) return false; diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index db48f56..8591e77 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc @@ -203,8 +203,8 @@ void OnGetNSSCertDatabaseForUser(net::NSSCertDatabase* database) { } // Returns new CommandLine with per-user flags. -CommandLine CreatePerSessionCommandLine(Profile* profile) { - CommandLine user_flags(CommandLine::NO_PROGRAM); +base::CommandLine CreatePerSessionCommandLine(Profile* profile) { + base::CommandLine user_flags(base::CommandLine::NO_PROGRAM); about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, about_flags::kAddSentinels); @@ -213,8 +213,8 @@ CommandLine CreatePerSessionCommandLine(Profile* profile) { // Returns true if restart is needed to apply per-session flags. bool NeedRestartToApplyPerSessionFlags( - const CommandLine& user_flags, - std::set<CommandLine::StringType>* out_command_line_difference) { + const base::CommandLine& user_flags, + std::set<base::CommandLine::StringType>* out_command_line_difference) { // Don't restart browser if it is not first profile in session. if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) return false; @@ -224,7 +224,7 @@ bool NeedRestartToApplyPerSessionFlags( return false; if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( - user_flags, *CommandLine::ForCurrentProcess(), + user_flags, *base::CommandLine::ForCurrentProcess(), out_command_line_difference)) { return false; } @@ -342,8 +342,9 @@ void UserSessionManager::CompleteGuestSessionLogin(const GURL& start_url) { // For guest session we ask session_manager to restart Chrome with --bwsi // flag. We keep only some of the arguments of this process. - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine command_line(browser_command_line.GetProgram()); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine command_line(browser_command_line.GetProgram()); std::string cmd_line_str = GetOffTheRecordCommandLine(start_url, StartupUtils::IsOobeCompleted(), @@ -356,14 +357,11 @@ void UserSessionManager::CompleteGuestSessionLogin(const GURL& start_url) { // the guest profile session flags will not match the current command line and // another restart will be attempted in order to reset the user flags for the // guest user. - const CommandLine user_flags(CommandLine::NO_PROGRAM); + const base::CommandLine user_flags(base::CommandLine::NO_PROGRAM); if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine( - user_flags, - *CommandLine::ForCurrentProcess(), - NULL)) { + user_flags, *base::CommandLine::ForCurrentProcess(), NULL)) { DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( - chromeos::login::kGuestUserName, - CommandLine::StringVector()); + chromeos::login::kGuestUserName, base::CommandLine::StringVector()); } RestartChrome(cmd_line_str); @@ -588,8 +586,8 @@ bool UserSessionManager::RestartToApplyPerSessionFlagsIfNeed( if (early_restart && !CanPerformEarlyRestart()) return false; - const CommandLine user_flags(CreatePerSessionCommandLine(profile)); - std::set<CommandLine::StringType> command_line_difference; + const base::CommandLine user_flags(CreatePerSessionCommandLine(profile)); + std::set<base::CommandLine::StringType> command_line_difference; if (!NeedRestartToApplyPerSessionFlags(user_flags, &command_line_difference)) return false; @@ -598,7 +596,7 @@ bool UserSessionManager::RestartToApplyPerSessionFlagsIfNeed( about_flags::ReportCustomFlags("Login.CustomFlags", command_line_difference); CommandLine::StringVector flags; - // argv[0] is the program name |CommandLine::NO_PROGRAM|. + // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); LOG(WARNING) << "Restarting to apply per-session flags..."; DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( @@ -728,7 +726,8 @@ void UserSessionManager::OnConnectionTypeChanged( void UserSessionManager::OnProfilePrepared(Profile* profile, bool browser_launched) { - if (!CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestName)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kTestName)) { // Did not log in (we crashed or are debugging), need to restore Sync. // TODO(nkostylev): Make sure that OAuth state is restored correctly for all // users once it is fully multi-profile aware. http://crbug.com/238987 @@ -751,7 +750,7 @@ void UserSessionManager::CreateUserSession(const UserContext& user_context, void UserSessionManager::PreStartSession() { // Switch log file as soon as possible. if (base::SysInfo::IsRunningOnChromeOS()) - logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); + logging::RedirectChromeLogging(*(base::CommandLine::ForCurrentProcess())); } void UserSessionManager::StartCrosSession() { @@ -1025,11 +1024,12 @@ void UserSessionManager::InitializeStartUrls() const { // Don't open default Chrome window if we're going to launch the first-run // app. Because we dont' want the first-run app to be hidden in the // background. - CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kSilentLaunch); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ::switches::kSilentLaunch); first_run::MaybeLaunchDialogAfterSessionStart(); } else { for (size_t i = 0; i < start_urls.size(); ++i) { - CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]); + base::CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]); } } } @@ -1044,7 +1044,7 @@ bool UserSessionManager::InitializeUserSession(Profile* profile) { if (start_session_type_ == PRIMARY_USER_SESSION) { UserFlow* user_flow = ChromeUserManager::Get()->GetCurrentUserFlow(); WizardController* oobe_controller = WizardController::default_controller(); - base::CommandLine* cmdline = CommandLine::ForCurrentProcess(); + base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); bool skip_post_login_screens = user_flow->ShouldSkipPostLoginScreens() || (oobe_controller && oobe_controller->skip_post_login_screens()) || @@ -1072,7 +1072,7 @@ bool UserSessionManager::InitializeUserSession(Profile* profile) { } void UserSessionManager::InitSessionRestoreStrategy() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool in_app_mode = chrome::IsRunningInForcedAppMode(); // Are we in kiosk app mode? @@ -1117,7 +1117,7 @@ void UserSessionManager::RestoreAuthSessionImpl( !restore_from_auth_cookies); if (chrome::IsRunningInForcedAppMode() || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDisableGaiaServices)) { return; } @@ -1439,7 +1439,7 @@ void UserSessionManager::DoBrowserLaunchInternal(Profile* profile, : chrome::startup::IS_NOT_FIRST_RUN; browser_creator.LaunchBrowser( - *CommandLine::ForCurrentProcess(), profile, base::FilePath(), + *base::CommandLine::ForCurrentProcess(), profile, base::FilePath(), chrome::startup::IS_PROCESS_STARTUP, first_run, &return_code); // Triggers app launcher start page service to load start page web contents. diff --git a/chrome/browser/chromeos/login/session_login_browsertest.cc b/chrome/browser/chromeos/login/session_login_browsertest.cc index 428e775..53538be 100644 --- a/chrome/browser/chromeos/login/session_login_browsertest.cc +++ b/chrome/browser/chromeos/login/session_login_browsertest.cc @@ -30,7 +30,7 @@ class BrowserLoginTest : public chromeos::LoginManagerTest { BrowserLoginTest() : LoginManagerTest(true) {} virtual ~BrowserLoginTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { LoginManagerTest::SetUpCommandLine(command_line); command_line->AppendSwitch(::switches::kCreateBrowserOnStartupForTests); } diff --git a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc index 30156bf..36bb855 100644 --- a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc +++ b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc @@ -134,7 +134,7 @@ class OAuth2Test : public OobeBaseTest { protected: OAuth2Test() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { OobeBaseTest::SetUpCommandLine(command_line); // Disable sync sinc we don't really need this for these tests and it also @@ -616,7 +616,7 @@ class MergeSessionTest : public OAuth2Test { fake_gaia_.reset(delayed_fake_gaia_); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { OAuth2Test::SetUpCommandLine(command_line); // Get fake URL for fake google.com. diff --git a/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc b/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc index 8128dda..15bda18 100644 --- a/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc +++ b/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc @@ -47,8 +47,8 @@ OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile) // For telemetry, we mark session restore completed to avoid warnings from // MergeSessionThrottle. - if (CommandLine::ForCurrentProcess()-> - HasSwitch(chromeos::switches::kDisableGaiaServices)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kDisableGaiaServices)) { SetSessionRestoreState(SESSION_RESTORE_DONE); } } diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc index bbb7e37..39d5e41 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc @@ -41,7 +41,8 @@ void SupervisedUserLoginFlow::AppendAdditionalCommandLineSwitches() { user_manager::UserManager* user_manager = user_manager::UserManager::Get(); if (user_manager->IsCurrentUserNew()) { // Supervised users should launch into empty desktop on first run. - CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kSilentLaunch); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ::switches::kSilentLaunch); } } diff --git a/chrome/browser/chromeos/login/test/oobe_base_test.cc b/chrome/browser/chromeos/login/test/oobe_base_test.cc index e96e0a4..544f74e 100644 --- a/chrome/browser/chromeos/login/test/oobe_base_test.cc +++ b/chrome/browser/chromeos/login/test/oobe_base_test.cc @@ -80,7 +80,7 @@ void OobeBaseTest::TearDownOnMainThread() { ExtensionApiTest::TearDownOnMainThread(); } -void OobeBaseTest::SetUpCommandLine(CommandLine* command_line) { +void OobeBaseTest::SetUpCommandLine(base::CommandLine* command_line) { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); diff --git a/chrome/browser/chromeos/login/test/wizard_in_process_browser_test.cc b/chrome/browser/chromeos/login/test/wizard_in_process_browser_test.cc index c2915ea..8b8978fa 100644 --- a/chrome/browser/chromeos/login/test/wizard_in_process_browser_test.cc +++ b/chrome/browser/chromeos/login/test/wizard_in_process_browser_test.cc @@ -27,7 +27,8 @@ void WizardInProcessBrowserTest::SetUp() { InProcessBrowserTest::SetUp(); } -void WizardInProcessBrowserTest::SetUpCommandLine(CommandLine* command_line) { +void WizardInProcessBrowserTest::SetUpCommandLine( + base::CommandLine* command_line) { command_line->AppendSwitch(::switches::kNoStartupWindow); command_line->AppendSwitch(switches::kLoginManager); } diff --git a/chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc b/chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc index 34a0103..20b5f6f 100644 --- a/chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc +++ b/chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc @@ -74,7 +74,7 @@ class CaptivePortalWindowTest : public InProcessBrowserTest { ASSERT_EQ(num_portal_notifications, delegate_.num_portal_notifications()); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); command_line->AppendSwitch(chromeos::switches::kLoginManager); } diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc index 678125f..ffcfde8 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc @@ -329,8 +329,9 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) bool is_registered = StartupUtils::IsDeviceRegistered(); bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); - bool disable_boot_animation = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableBootAnimation); + bool disable_boot_animation = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableBootAnimation); waiting_for_wallpaper_load_ = !zero_delay_enabled && (!is_registered || !disable_boot_animation); @@ -350,9 +351,10 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) kHiddenWebUIInitializationDefault && !zero_delay_enabled; // Check if WebUI init type is overriden. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshWebUIInit)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshWebUIInit)) { const std::string override_type = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kAshWebUIInit); if (override_type == kWebUIInitParallel) initialize_webui_hidden_ = true; @@ -947,7 +949,7 @@ void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { return; } - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableLoginAnimations)) ash::Shell::GetInstance()->DoInitialWorkspaceAnimation(); #endif @@ -1179,7 +1181,7 @@ void ShowLoginWizard(const std::string& first_screen_name) { prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); } system::InputDeviceSettings::Get()->SetNaturalScroll( - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNaturalScrollDefault)); #endif diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc index d7f5860..a8088e3 100644 --- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc +++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc @@ -764,7 +764,7 @@ void ChromeUserManagerImpl::KioskAppLoggedIn(const std::string& app_id) { NOTREACHED(); } - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(::switches::kForceAppMode); command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); @@ -787,14 +787,14 @@ void ChromeUserManagerImpl::DemoAccountLoggedIn() { WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); #endif - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(::switches::kForceAppMode); command_line->AppendSwitchASCII(::switches::kAppId, DemoAppLauncher::kDemoAppId); // Disable window animation since the demo app runs in a single full screen // window and window animation causes start-up janks. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( wm::switches::kWindowAnimationsDisabled); } diff --git a/chrome/browser/chromeos/login/users/user_manager_unittest.cc b/chrome/browser/chromeos/login/users/user_manager_unittest.cc index ef2b9c7..82dadcc 100644 --- a/chrome/browser/chromeos/login/users/user_manager_unittest.cc +++ b/chrome/browser/chromeos/login/users/user_manager_unittest.cc @@ -54,7 +54,7 @@ class UnittestProfileManager : public ::ProfileManagerWithoutInit { class UserManagerTest : public testing::Test { protected: virtual void SetUp() override { - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); command_line.AppendSwitch(::switches::kTestType); command_line.AppendSwitch( chromeos::switches::kIgnoreUserProfileMappingForTests); diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc index b00c729..3428695 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc @@ -374,7 +374,7 @@ void WallpaperManager::InitializeWallpaper() { scoped_ptr<gfx::ImageSkia>().Pass()); } - CommandLine* command_line = GetCommandLine(); + base::CommandLine* command_line = GetCommandLine(); if (command_line->HasSwitch(chromeos::switches::kGuestSession)) { // Guest wallpaper should be initialized when guest login. // Note: This maybe called before login. So IsLoggedInAsGuest can not be diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc index 147ca79..8c7adbb 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc @@ -77,7 +77,7 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest { UpdateDisplay("800x600"); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); } @@ -348,7 +348,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, class WallpaperManagerBrowserTestNoAnimation : public WallpaperManagerBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations); @@ -411,7 +411,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, class WallpaperManagerBrowserTestCrashRestore : public WallpaperManagerBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kDisableLoginAnimations); command_line->AppendSwitch(chromeos::switches::kDisableBootAnimation); command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1); @@ -441,7 +441,7 @@ IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestCrashRestore, class WallpaperManagerBrowserTestCacheUpdate : public WallpaperManagerBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kLoginUser, kTestUser1); command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); } diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc index 21936a8..8d10195 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc @@ -171,7 +171,7 @@ class WallpaperManagerPolicyTest ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_)); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { // Set the same switches as LoginManagerTest, except that kMultiProfiles is // only set when GetParam() is true and except that kLoginProfile is set // when GetParam() is false. The latter seems to be required for the sane diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 998f0f0..8b8bc36 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -106,8 +106,8 @@ const char *kResumableScreens[] = { // Checks flag for HID-detection screen show. bool CanShowHIDDetectionScreen() { - return !CommandLine::ForCurrentProcess()->HasSwitch( - chromeos::switches::kDisableHIDDetectionOnOOBE); + return !base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kDisableHIDDetectionOnOOBE); } bool IsResumableScreen(const std::string& screen) { @@ -1252,8 +1252,9 @@ bool WizardController::SetOnTimeZoneResolvedForTesting( bool WizardController::IsHostPairingOobe() const { return IsRemoraRequisition() && - (CommandLine::ForCurrentProcess()->HasSwitch(switches::kHostPairingOobe) || - shark_controller_detected_); + (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kHostPairingOobe) || + shark_controller_detected_); } void WizardController::MaybeStartListeningForSharkConnection() { diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 1114983..a6bf6a3 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -731,7 +731,7 @@ class WizardControllerDeviceStateTest : public WizardControllerFlowTest { "2000-01"); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { WizardControllerFlowTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( @@ -980,7 +980,7 @@ class WizardControllerProxyAuthOnSigninTest : public WizardControllerTest { WizardController::kNetworkScreenName); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(::switches::kProxyServer, proxy_server_.host_port_pair().ToString()); } @@ -1010,7 +1010,7 @@ class WizardControllerKioskFlowTest : public WizardControllerFlowTest { WizardControllerKioskFlowTest() {} // Overridden from InProcessBrowserTest: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { base::FilePath test_data_dir; ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( "app_mode", "kiosk_manifest", &test_data_dir)); @@ -1117,7 +1117,7 @@ class WizardControllerEnableDebuggingTest : public WizardControllerFlowTest { WizardControllerEnableDebuggingTest() {} // Overridden from InProcessBrowserTest: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { WizardControllerFlowTest::SetUpCommandLine(command_line); command_line->AppendSwitch(chromeos::switches::kSystemDevMode); } diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc index d1a3102..7a81f01 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc @@ -221,7 +221,7 @@ void NetworkPortalDetectorImpl::Initialize( return; CHECK(!NetworkPortalDetector::network_portal_detector()) << "NetworkPortalDetector was initialized twice."; - if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType)) set_network_portal_detector(new NetworkPortalDetectorStubImpl()); else set_network_portal_detector(new NetworkPortalDetectorImpl(url_context)); diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc index 235a4e6..0a8d6a7 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc @@ -67,7 +67,7 @@ class NetworkPortalDetectorImplTest public captive_portal::CaptivePortalDetectorTestBase { protected: virtual void SetUp() { - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); cl->AppendSwitch(switches::kDisableNetworkPortalNotification); DBusThreadManager::Initialize(); diff --git a/chrome/browser/chromeos/net/network_portal_notification_controller.cc b/chrome/browser/chromeos/net/network_portal_notification_controller.cc index 137c3f2..aa583c3 100644 --- a/chrome/browser/chromeos/net/network_portal_notification_controller.cc +++ b/chrome/browser/chromeos/net/network_portal_notification_controller.cc @@ -42,7 +42,7 @@ namespace chromeos { namespace { bool IsPortalNotificationEnabled() { - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableNetworkPortalNotification); } @@ -101,7 +101,7 @@ void NetworkPortalNotificationControllerDelegate::Click() { NetworkPortalNotificationController::USER_ACTION_METRIC_CLICKED, NetworkPortalNotificationController::USER_ACTION_METRIC_COUNT); - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kEnableCaptivePortalBypassProxy)) { if (controller_) controller_->ShowDialog(); diff --git a/chrome/browser/chromeos/net/network_portal_notification_controller_unittest.cc b/chrome/browser/chromeos/net/network_portal_notification_controller_unittest.cc index 87ad5bd..dd357a8 100644 --- a/chrome/browser/chromeos/net/network_portal_notification_controller_unittest.cc +++ b/chrome/browser/chromeos/net/network_portal_notification_controller_unittest.cc @@ -67,7 +67,7 @@ class NetworkPortalNotificationControllerTest : public testing::Test { virtual ~NetworkPortalNotificationControllerTest() {} virtual void SetUp() override { - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); cl->AppendSwitch(switches::kEnableNetworkPortalNotification); MessageCenter::Initialize(); MessageCenter::Get()->AddObserver(&observer_); diff --git a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc index 8af8a78..09d5574 100644 --- a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc +++ b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc @@ -47,7 +47,8 @@ namespace { bool IsOwnerInTests(const std::string& user_id) { if (user_id.empty() || - !CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType) || + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kTestType) || !CrosSettings::IsInitialized()) { return false; } diff --git a/chrome/browser/chromeos/policy/blocking_login_browsertest.cc b/chrome/browser/chromeos/policy/blocking_login_browsertest.cc index c0f7533..821136f 100644 --- a/chrome/browser/chromeos/policy/blocking_login_browsertest.cc +++ b/chrome/browser/chromeos/policy/blocking_login_browsertest.cc @@ -87,7 +87,7 @@ class BlockingLoginTest public: BlockingLoginTest() : profile_added_(NULL) {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { // Initialize the test server early, so that we can use its base url for // the command line flags. ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); diff --git a/chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc b/chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc index a3d2d3a..a329ba0 100644 --- a/chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc +++ b/chrome/browser/chromeos/policy/browser_policy_connector_chromeos.cc @@ -74,7 +74,8 @@ scoped_refptr<base::SequencedTaskRunner> GetBackgroundTaskRunner() { } std::string GetDeviceManagementServerUrlForConsumer() { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch( chromeos::switches::kConsumerDeviceManagementUrl)) { return command_line->GetSwitchValueASCII( @@ -115,7 +116,8 @@ BrowserPolicyConnectorChromeOS::BrowserPolicyConnectorChromeOS() &install_attrs_file)); install_attributes_->ReadCacheFile(install_attrs_file); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch( chromeos::switches::kEnableConsumerManagement)) { consumer_management_service_.reset( @@ -149,7 +151,8 @@ void BrowserPolicyConnectorChromeOS::Init( scoped_refptr<net::URLRequestContextGetter> request_context) { ChromeBrowserPolicyConnector::Init(local_state, request_context); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement)) { scoped_ptr<DeviceManagementService::Configuration> configuration( new DeviceManagementServiceConfiguration( diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index 05f40a1..3901c6d 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc @@ -431,7 +431,7 @@ class DeviceLocalAccountTest : public DevicePolicyCrosBrowserTest, DevicePolicyCrosBrowserTest::SetUp(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { DevicePolicyCrosBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); @@ -445,8 +445,8 @@ class DeviceLocalAccountTest : public DevicePolicyCrosBrowserTest, // Clear command-line arguments (but keep command-line switches) so the // startup pages policy takes effect. - CommandLine* command_line = CommandLine::ForCurrentProcess(); - CommandLine::StringVector argv(command_line->argv()); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringVector argv(command_line->argv()); argv.erase(argv.begin() + argv.size() - command_line->GetArgs().size(), argv.end()); command_line->InitFromArgv(argv); diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service.cc index 19a8f3b..150095c 100644 --- a/chrome/browser/chromeos/policy/device_local_account_policy_service.cc +++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.cc @@ -215,7 +215,7 @@ void DeviceLocalAccountPolicyBroker::OnComponentCloudPolicyUpdated() { void DeviceLocalAccountPolicyBroker::CreateComponentCloudPolicyService( const scoped_refptr<net::URLRequestContextGetter>& request_context, CloudPolicyClient* client) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableComponentCloudPolicy)) { // Disabled via the command line. return; diff --git a/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc b/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc index e676c93..3367ef8 100644 --- a/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc @@ -25,7 +25,7 @@ class SystemUse24HourClockPolicyTest SystemUse24HourClockPolicyTest() { } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); } diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc index 6298397..6b0b932 100644 --- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc +++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc @@ -262,7 +262,7 @@ void EnrollmentHandlerChromeOS::HandlePolicyValidationResult( device_id_ = validator->policy_data()->device_id(); request_token_ = validator->policy_data()->request_token(); - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kEnterpriseEnrollmentSkipRobotAuth)) { // For test purposes we allow enrollment to succeed without proper robot // account and use the provided value as a token. diff --git a/chrome/browser/chromeos/policy/login_screen_default_policy_browsertest.cc b/chrome/browser/chromeos/policy/login_screen_default_policy_browsertest.cc index c93f0f4..64e8dfa 100644 --- a/chrome/browser/chromeos/policy/login_screen_default_policy_browsertest.cc +++ b/chrome/browser/chromeos/policy/login_screen_default_policy_browsertest.cc @@ -103,7 +103,7 @@ class LoginScreenDefaultPolicyLoginScreenBrowsertest virtual ~LoginScreenDefaultPolicyLoginScreenBrowsertest(); // LoginScreenDefaultPolicyBrowsertestBase: - virtual void SetUpCommandLine(CommandLine* command_line) override; + virtual void SetUpCommandLine(base::CommandLine* command_line) override; virtual void SetUpOnMainThread() override; virtual void TearDownOnMainThread() override; @@ -166,7 +166,7 @@ LoginScreenDefaultPolicyLoginScreenBrowsertest:: } void LoginScreenDefaultPolicyLoginScreenBrowsertest::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { LoginScreenDefaultPolicyBrowsertestBase::SetUpCommandLine(command_line); command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); diff --git a/chrome/browser/chromeos/policy/power_policy_browsertest.cc b/chrome/browser/chromeos/policy/power_policy_browsertest.cc index 28a8e95..e12bacb 100644 --- a/chrome/browser/chromeos/policy/power_policy_browsertest.cc +++ b/chrome/browser/chromeos/policy/power_policy_browsertest.cc @@ -155,7 +155,7 @@ class PowerPolicyLoginScreenBrowserTest : public PowerPolicyBrowserTestBase { PowerPolicyLoginScreenBrowserTest(); // PowerPolicyBrowserTestBase: - virtual void SetUpCommandLine(CommandLine* command_line) override; + virtual void SetUpCommandLine(base::CommandLine* command_line) override; virtual void SetUpOnMainThread() override; virtual void TearDownOnMainThread() override; @@ -277,7 +277,7 @@ PowerPolicyLoginScreenBrowserTest::PowerPolicyLoginScreenBrowserTest() { } void PowerPolicyLoginScreenBrowserTest::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { PowerPolicyBrowserTestBase::SetUpCommandLine(command_line); command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); diff --git a/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc b/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc index 41f12c7..8697446 100644 --- a/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc +++ b/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc @@ -16,7 +16,7 @@ TiclDeviceSettingsProvider::~TiclDeviceSettingsProvider() { } bool TiclDeviceSettingsProvider::UseGCMChannel() const { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kInvalidationUseGCMChannel); } diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc index 0953f6a..19f43fd 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc @@ -68,7 +68,7 @@ class UserCloudPolicyManagerTest : public chromeos::OobeBaseTest { OobeBaseTest::SetUp(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, test_server_->GetServiceURL().spec()); OobeBaseTest::SetUpCommandLine(command_line); diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc index 9a4b8d5..762a0ce 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc @@ -116,7 +116,8 @@ scoped_ptr<UserCloudPolicyManagerChromeOS> Profile* profile, bool force_immediate_load, scoped_refptr<base::SequencedTaskRunner> background_task_runner) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); // Don't initialize cloud policy for the signin profile. if (chromeos::ProfileHelper::IsSigninProfile(profile)) return scoped_ptr<UserCloudPolicyManagerChromeOS>(); diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 6ab83e2..6cd8097 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -122,9 +122,8 @@ void Preferences::RegisterProfilePrefs( false, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref( - prefs::kNaturalScroll, - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kNaturalScrollDefault), + prefs::kNaturalScroll, base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNaturalScrollDefault), user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); registry->RegisterBooleanPref( prefs::kPrimaryMouseButtonRight, @@ -390,7 +389,8 @@ void Preferences::Init(Profile* profile, const user_manager::User* user) { // If a guest is logged in, initialize the prefs as if this is the first // login. For a regular user this is done in // UserSessionManager::InitProfilePreferences(). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kGuestSession)) session_manager->SetFirstLoginPrefs(profile, std::string(), std::string()); } @@ -616,10 +616,9 @@ void Preferences::OnIsSyncingChanged() { void Preferences::ForceNaturalScrollDefault() { DVLOG(1) << "ForceNaturalScrollDefault"; - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNaturalScrollDefault) && - prefs_->IsSyncing() && - !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { + prefs_->IsSyncing() && !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { DVLOG(1) << "Natural scroll forced to true"; natural_scroll_.SetValue(true); UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); diff --git a/chrome/browser/chromeos/preferences_browsertest.cc b/chrome/browser/chromeos/preferences_browsertest.cc index 2944399..5e3474f 100644 --- a/chrome/browser/chromeos/preferences_browsertest.cc +++ b/chrome/browser/chromeos/preferences_browsertest.cc @@ -44,7 +44,7 @@ class PreferencesTest : public LoginManagerTest { input_settings_(NULL), keyboard_(NULL) {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { LoginManagerTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kStubCrosSettings); } diff --git a/chrome/browser/chromeos/profiles/profile_helper.cc b/chrome/browser/chromeos/profiles/profile_helper.cc index 5f7c3ac..e66cd56 100644 --- a/chrome/browser/chromeos/profiles/profile_helper.cc +++ b/chrome/browser/chromeos/profiles/profile_helper.cc @@ -295,7 +295,7 @@ user_manager::User* ProfileHelper::GetUserByProfile(Profile* profile) { // Now these tests will specify special flag to continue working. // In future those tests can get a proper CrOS configuration i.e. register // and login several users if they want to work with an additional profile. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kIgnoreUserProfileMappingForTests)) { return user_manager->GetActiveUser(); } diff --git a/chrome/browser/chromeos/settings/cros_settings.cc b/chrome/browser/chromeos/settings/cros_settings.cc index ac0b30b..96427d2 100644 --- a/chrome/browser/chromeos/settings/cros_settings.cc +++ b/chrome/browser/chromeos/settings/cros_settings.cc @@ -50,7 +50,7 @@ CrosSettings::CrosSettings(DeviceSettingsService* device_settings_service) { base::Bind(&CrosSettings::FireObservers, // This is safe since |this| is never deleted. base::Unretained(this))); - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kStubCrosSettings)) { AddSettingsProvider(new StubCrosSettingsProvider(notify_cb)); } else { diff --git a/chrome/browser/chromeos/settings/owner_flags_storage.cc b/chrome/browser/chromeos/settings/owner_flags_storage.cc index e3af783..8e8d0de 100644 --- a/chrome/browser/chromeos/settings/owner_flags_storage.cc +++ b/chrome/browser/chromeos/settings/owner_flags_storage.cc @@ -52,11 +52,12 @@ bool OwnerFlagsStorage::SetFlags(const std::set<std::string>& flags) { base::ListValue experiments_list; - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); ::about_flags::ConvertFlagsToSwitches(this, &command_line, ::about_flags::kNoSentinels); - CommandLine::StringVector switches = command_line.argv(); - for (CommandLine::StringVector::const_iterator it = switches.begin() + 1; + base::CommandLine::StringVector switches = command_line.argv(); + for (base::CommandLine::StringVector::const_iterator it = + switches.begin() + 1; it != switches.end(); ++it) { experiments_list.Append(new base::StringValue(*it)); } diff --git a/chrome/browser/chromeos/system/device_disabling_browsertest.cc b/chrome/browser/chromeos/system/device_disabling_browsertest.cc index 79250c8..a7ec074 100644 --- a/chrome/browser/chromeos/system/device_disabling_browsertest.cc +++ b/chrome/browser/chromeos/system/device_disabling_browsertest.cc @@ -33,7 +33,7 @@ class DeviceDisablingTest : public InProcessBrowserTest { private: // InProcessBrowserTest: void SetUpInProcessBrowserTestFixture() override; - void SetUpCommandLine(CommandLine* command_line) override; + void SetUpCommandLine(base::CommandLine* command_line) override; FakeSessionManagerClient* fake_session_manager_client_; policy::DevicePolicyCrosTestHelper test_helper_; @@ -65,7 +65,7 @@ void DeviceDisablingTest::SetUpInProcessBrowserTestFixture() { test_helper_.MarkAsEnterpriseOwned(); } -void DeviceDisablingTest::SetUpCommandLine(CommandLine* command_line) { +void DeviceDisablingTest::SetUpCommandLine(base::CommandLine* command_line) { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitch(switches::kForceLoginManagerInTests); } diff --git a/chrome/browser/chromeos/system/device_disabling_manager.cc b/chrome/browser/chromeos/system/device_disabling_manager.cc index 165a8f4..3b87871 100644 --- a/chrome/browser/chromeos/system/device_disabling_manager.cc +++ b/chrome/browser/chromeos/system/device_disabling_manager.cc @@ -58,7 +58,7 @@ void DeviceDisablingManager::RemoveObserver(Observer* observer) { } void DeviceDisablingManager::Init() { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableDeviceDisabling)) { // If device disabling is turned off by flags, do not start monitoring cros // settings. @@ -91,7 +91,7 @@ void DeviceDisablingManager::CacheDisabledMessageAndNotify( void DeviceDisablingManager::CheckWhetherDeviceDisabledDuringOOBE( const DeviceDisabledCheckCallback& callback) { if (policy::GetRestoreMode() != policy::RESTORE_MODE_DISABLED || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableDeviceDisabling)) { // Indicate that the device is not disabled if it is not marked as such in // local state or device disabling has been turned off by flag. @@ -150,10 +150,11 @@ void DeviceDisablingManager::CheckWhetherDeviceDisabledDuringOOBE( bool DeviceDisablingManager::HonorDeviceDisablingDuringNormalOperation() { // Device disabling should be honored when the device is enterprise managed // and device disabling has not been turned off by flag. - return g_browser_process->platform_part()-> - browser_policy_connector_chromeos()->IsEnterpriseManaged() && - !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableDeviceDisabling); + return g_browser_process->platform_part() + ->browser_policy_connector_chromeos() + ->IsEnterpriseManaged() && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableDeviceDisabling); } void DeviceDisablingManager::UpdateFromCrosSettings() { diff --git a/chrome/browser/chromeos/system/device_disabling_manager_unittest.cc b/chrome/browser/chromeos/system/device_disabling_manager_unittest.cc index f20bd6e..5453267 100644 --- a/chrome/browser/chromeos/system/device_disabling_manager_unittest.cc +++ b/chrome/browser/chromeos/system/device_disabling_manager_unittest.cc @@ -202,7 +202,7 @@ TEST_F(DeviceDisablingManagerOOBETest, NotDisabledWhenExplicitlyNotDisabled) { // Verifies that the device is not considered disabled during OOBE when device // disabling is turned off by flag, even if the device is marked as disabled. TEST_F(DeviceDisablingManagerOOBETest, NotDisabledWhenTurnedOffByFlag) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableDeviceDisabling); SetDeviceDisabled(true); CheckWhetherDeviceDisabledDuringOOBE(); @@ -375,7 +375,7 @@ TEST_F(DeviceDisablingManagerTest, NotDisabledWhenExplicitlyNotDisabled) { // Verifies that the device is not considered disabled when device disabling is // turned off by flag, even if the device is marked as disabled. TEST_F(DeviceDisablingManagerTest, NotDisabledWhenTurnedOffByFlag) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableDeviceDisabling); SetEnterpriseOwned(); MakeCrosSettingsTrusted(); @@ -500,7 +500,7 @@ TEST_F(DeviceDisablingManagerTest, HonorDeviceDisablingDuringNormalOperation) { DeviceDisablingManager::HonorDeviceDisablingDuringNormalOperation()); // Enterprise owned, disabled by flag. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableDeviceDisabling); EXPECT_FALSE( DeviceDisablingManager::HonorDeviceDisablingDuringNormalOperation()); diff --git a/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc b/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc index b2cc353..0c10157 100644 --- a/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc +++ b/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc @@ -56,7 +56,7 @@ void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) { return; base::ProcessHandle handle; - base::LaunchProcess(CommandLine(argv), base::LaunchOptions(), &handle); + base::LaunchProcess(base::CommandLine(argv), base::LaunchOptions(), &handle); base::EnsureProcessGetsReaped(handle); } @@ -66,8 +66,8 @@ void ExecuteScript(const std::vector<std::string>& argv) { if (argv.size() == 1) return; - VLOG(1) << "About to launch: \"" << CommandLine(argv).GetCommandLineString() - << "\""; + VLOG(1) << "About to launch: \"" + << base::CommandLine(argv).GetCommandLineString() << "\""; // Control scripts can take long enough to cause SIGART during shutdown // (http://crbug.com/261426). Run the blocking pool task with @@ -107,7 +107,7 @@ void DeviceExistsBlockingPool(const char* device_type, std::string output; // Output is empty if the device is not found. exists->data = - base::GetAppOutput(CommandLine(argv), &output) && !output.empty(); + base::GetAppOutput(base::CommandLine(argv), &output) && !output.empty(); DVLOG(1) << "DeviceExistsBlockingPool:" << device_type << "=" << exists->data; } diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc index c933337..3323842 100644 --- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc +++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc @@ -75,7 +75,7 @@ class TrayAccessibilityTest AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitchASCII(switches::kLoginProfile, TestingProfile::kTestUserProfileDir); diff --git a/chrome/browser/chromeos/system_logs/command_line_log_source.cc b/chrome/browser/chromeos/system_logs/command_line_log_source.cc index c6b50b5..692cc2c 100644 --- a/chrome/browser/chromeos/system_logs/command_line_log_source.cc +++ b/chrome/browser/chromeos/system_logs/command_line_log_source.cc @@ -22,26 +22,26 @@ namespace { void ExecuteCommandLines(system_logs::SystemLogsResponse* response) { // TODO(tudalex): Move program calling in a array or something similar to make // it more easier to modify and understand. - std::vector<std::pair<std::string, CommandLine> > commands; + std::vector<std::pair<std::string, base::CommandLine>> commands; - CommandLine command(base::FilePath("/usr/bin/amixer")); + base::CommandLine command(base::FilePath("/usr/bin/amixer")); command.AppendArg("-c0"); command.AppendArg("contents"); commands.push_back(std::make_pair("alsa controls", command)); - command = CommandLine((base::FilePath("/usr/bin/cras_test_client"))); + command = base::CommandLine((base::FilePath("/usr/bin/cras_test_client"))); command.AppendArg("--dump_server_info"); command.AppendArg("--dump_audio_thread"); commands.push_back(std::make_pair("cras", command)); - command = CommandLine((base::FilePath("/usr/bin/audio_diagnostics"))); + command = base::CommandLine((base::FilePath("/usr/bin/audio_diagnostics"))); commands.push_back(std::make_pair("audio_diagnostics", command)); #if 0 // This command hangs as of R39. TODO(alhli): Make cras_test_client more // robust or add a wrapper script that times out, and fix this or remove // this code. crbug.com/419523 - command = CommandLine((base::FilePath("/usr/bin/cras_test_client"))); + command = base::CommandLine((base::FilePath("/usr/bin/cras_test_client"))); command.AppendArg("--loopback_file"); command.AppendArg("/dev/null"); command.AppendArg("--rate"); @@ -52,33 +52,33 @@ void ExecuteCommandLines(system_logs::SystemLogsResponse* response) { commands.push_back(std::make_pair("cras_rms", command)); #endif - command = CommandLine((base::FilePath("/usr/bin/printenv"))); + command = base::CommandLine((base::FilePath("/usr/bin/printenv"))); commands.push_back(std::make_pair("env", command)); - command = CommandLine(base::FilePath("/usr/bin/setxkbmap")); + command = base::CommandLine(base::FilePath("/usr/bin/setxkbmap")); command.AppendArg("-print"); command.AppendArg("-query"); commands.push_back(std::make_pair("setxkbmap", command)); - command = CommandLine(base::FilePath("/usr/bin/xinput")); + command = base::CommandLine(base::FilePath("/usr/bin/xinput")); command.AppendArg("list"); command.AppendArg("--long"); commands.push_back(std::make_pair("xinput", command)); - command = CommandLine(base::FilePath("/usr/bin/xrandr")); + command = base::CommandLine(base::FilePath("/usr/bin/xrandr")); command.AppendArg("--verbose"); commands.push_back(std::make_pair("xrandr", command)); // Get a list of file sizes for the logged in user (excluding the names of // the files in the Downloads directory for privay reasons). - command = CommandLine(base::FilePath("/bin/sh")); + command = base::CommandLine(base::FilePath("/bin/sh")); command.AppendArg("-c"); command.AppendArg("/usr/bin/du -h /home/chronos/user |" " grep -v -e \\/home\\/chronos\\/user\\/Downloads\\/"); commands.push_back(std::make_pair("user_files", command)); // Get disk space usage information - command = CommandLine(base::FilePath("/bin/df")); + command = base::CommandLine(base::FilePath("/bin/df")); commands.push_back(std::make_pair("disk_usage", command)); for (size_t i = 0; i < commands.size(); ++i) { diff --git a/chrome/browser/chromeos/system_logs/debug_log_writer.cc b/chrome/browser/chromeos/system_logs/debug_log_writer.cc index 8519c11..46f9749 100644 --- a/chrome/browser/chromeos/system_logs/debug_log_writer.cc +++ b/chrome/browser/chromeos/system_logs/debug_log_writer.cc @@ -190,7 +190,7 @@ void OnSystemLogsAdded(const DebugLogWriter::StoreLogsCallback& callback, base::FilePath compressed_output_path = tar_file_path.AddExtension(FILE_PATH_LITERAL(".gz")); base::FilePath user_log_dir = - logging::GetSessionLogDir(*CommandLine::ForCurrentProcess()); + logging::GetSessionLogDir(*base::CommandLine::ForCurrentProcess()); content::BrowserThread::PostBlockingPoolTask( FROM_HERE, diff --git a/chrome/browser/chromeos/system_logs/touch_log_source_x11.cc b/chrome/browser/chromeos/system_logs/touch_log_source_x11.cc index 2846f80..fa27399 100644 --- a/chrome/browser/chromeos/system_logs/touch_log_source_x11.cc +++ b/chrome/browser/chromeos/system_logs/touch_log_source_x11.cc @@ -29,16 +29,17 @@ void GetTouchLogsX11(system_logs::SystemLogsResponse* response) { (*response)[kHUDLogDataKey] = touch_log; } - std::vector<std::pair<std::string, CommandLine>> commands; - CommandLine command = - CommandLine(base::FilePath("/opt/google/input/inputcontrol")); + std::vector<std::pair<std::string, base::CommandLine>> commands; + base::CommandLine command = + base::CommandLine(base::FilePath("/opt/google/input/inputcontrol")); command.AppendArg("--status"); commands.push_back(std::make_pair("hack-33025-touchpad", command)); - command = CommandLine(base::FilePath("/opt/google/input/cmt_feedback")); + command = base::CommandLine(base::FilePath("/opt/google/input/cmt_feedback")); commands.push_back(std::make_pair("hack-33025-touchpad_activity", command)); - command = CommandLine(base::FilePath("/opt/google/input/evdev_feedback")); + command = + base::CommandLine(base::FilePath("/opt/google/input/evdev_feedback")); commands.push_back( std::make_pair("hack-33025-touchscreen_activity", command)); diff --git a/chrome/browser/chromeos/ui/idle_app_name_notification_view_unittest.cc b/chrome/browser/chromeos/ui/idle_app_name_notification_view_unittest.cc index 2f2481e..bc53a2f 100644 --- a/chrome/browser/chromeos/ui/idle_app_name_notification_view_unittest.cc +++ b/chrome/browser/chromeos/ui/idle_app_name_notification_view_unittest.cc @@ -32,8 +32,8 @@ class IdleAppNameNotificationViewTest : public BrowserWithTestWindowTest { virtual void SetUp() override { // Add the application switch. - CommandLine::ForCurrentProcess()->AppendSwitchASCII(::switches::kAppId, - kTestAppName); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + ::switches::kAppId, kTestAppName); BrowserWithTestWindowTest::SetUp(); diff --git a/chrome/browser/component_updater/chrome_component_updater_configurator.cc b/chrome/browser/component_updater/chrome_component_updater_configurator.cc index 5810154..aac305a 100644 --- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc +++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc @@ -109,7 +109,7 @@ std::string GetSwitchArgument(const std::vector<std::string>& vec, class ChromeConfigurator : public Configurator { public: - ChromeConfigurator(const CommandLine* cmdline, + ChromeConfigurator(const base::CommandLine* cmdline, net::URLRequestContextGetter* url_request_getter); ~ChromeConfigurator() override {} @@ -149,7 +149,7 @@ class ChromeConfigurator : public Configurator { }; ChromeConfigurator::ChromeConfigurator( - const CommandLine* cmdline, + const base::CommandLine* cmdline, net::URLRequestContextGetter* url_request_getter) : url_request_getter_(url_request_getter), fast_update_(false), diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index c7ec020..8ad0e25 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -504,7 +504,7 @@ void RegisterPepperFlashComponent(ComponentUpdateService* cus) { #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) // Component updated flash supersedes bundled flash therefore if that one // is disabled then this one should never install. - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) return; BrowserThread::PostTask(BrowserThread::FILE, diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc index ebcb206..f0d67db 100644 --- a/chrome/browser/component_updater/recovery_component_installer.cc +++ b/chrome/browser/component_updater/recovery_component_installer.cc @@ -62,8 +62,8 @@ enum ChromeRecoveryExitCode { // Checks if elevated recovery simulation switch was present on the command // line. This is for testing purpose. bool SimulatingElevatedRecovery() { - return CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kSimulateElevatedRecovery); + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSimulateElevatedRecovery); } #endif @@ -97,7 +97,7 @@ void DoElevatedInstallRecoveryComponent(const base::FilePath& path) { if (!version.IsValid()) return; - CommandLine cmdline(main_file); + base::CommandLine cmdline(main_file); std::string arguments; if (manifest->GetStringASCII("x-recovery-args", &arguments)) cmdline.AppendArg(arguments); @@ -145,7 +145,7 @@ class RecoveryComponentInstaller : public ComponentInstaller { base::FilePath* installed_file) override; private: - bool RunInstallCommand(const CommandLine& cmdline, + bool RunInstallCommand(const base::CommandLine& cmdline, const base::FilePath& installer_folder) const; Version current_version_; @@ -217,7 +217,8 @@ void WaitForInstallToComplete(base::ProcessHandle process_handle, } bool RecoveryComponentInstaller::RunInstallCommand( - const CommandLine& cmdline, const base::FilePath& installer_folder) const { + const base::CommandLine& cmdline, + const base::FilePath& installer_folder) const { base::ProcessHandle process_handle; base::LaunchOptions options; options.start_hidden = true; @@ -238,7 +239,8 @@ bool RecoveryComponentInstaller::RunInstallCommand( } #else bool RecoveryComponentInstaller::RunInstallCommand( - const CommandLine& cmdline, const base::FilePath&) const { + const base::CommandLine& cmdline, + const base::FilePath&) const { return base::LaunchProcess(cmdline, base::LaunchOptions(), NULL); } #endif @@ -275,7 +277,7 @@ bool RecoveryComponentInstaller::Install(const base::DictionaryValue& manifest, if (!base::PathExists(main_file)) return false; // Run the recovery component. - CommandLine cmdline(main_file); + base::CommandLine cmdline(main_file); std::string arguments; if (manifest.GetStringASCII("x-recovery-args", &arguments)) cmdline.AppendArg(arguments); diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index 7952ee9..f6f0606 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc @@ -299,7 +299,7 @@ class ClickToPlayPluginTest : public ContentSettingsTest { ClickToPlayPluginTest() {} #if defined(OS_MACOSX) - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { base::FilePath plugin_dir; PathService::Get(base::DIR_MODULE, &plugin_dir); plugin_dir = plugin_dir.AppendASCII("plugins"); @@ -470,7 +470,7 @@ class PepperContentSettingsSpecialCasesTest : public ContentSettingsTest { static const char* const kExternalClearKeyMimeType; // Registers any CDM plugins not registered by default. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { #if defined(ENABLE_PEPPER_CDMS) // Platform-specific filename relative to the chrome executable. #if defined(OS_WIN) @@ -641,7 +641,8 @@ class PepperContentSettingsSpecialCasesJavaScriptBlockedTest IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesTest, Baseline) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( @@ -660,7 +661,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesPluginsBlockedTest, Normal) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunLoadPepperPluginTest(kExternalClearKeyMimeType, false); @@ -671,7 +673,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesPluginsBlockedTest, WidevineCdm) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunLoadPepperPluginTest(kWidevineCdmPluginMimeType, true); @@ -684,7 +687,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesPluginsBlockedTest, NaCl) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunLoadPepperPluginTest("application/x-nacl", true); @@ -700,7 +704,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesJavaScriptBlockedTest, Normal) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunJavaScriptBlockedTest("load_clearkey_no_js.html", false); @@ -711,7 +716,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesJavaScriptBlockedTest, WidevineCdm) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunJavaScriptBlockedTest("load_widevine_no_js.html", true); @@ -724,7 +730,8 @@ IN_PROC_BROWSER_TEST_F(PepperContentSettingsSpecialCasesJavaScriptBlockedTest, NaCl) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif RunJavaScriptBlockedTest("load_nacl_no_js.html", true); diff --git a/chrome/browser/devtools/device/port_forwarding_browsertest.cc b/chrome/browser/devtools/device/port_forwarding_browsertest.cc index e596ce4..7f90128 100644 --- a/chrome/browser/devtools/device/port_forwarding_browsertest.cc +++ b/chrome/browser/devtools/device/port_forwarding_browsertest.cc @@ -34,7 +34,7 @@ class PortForwardingTest: public InProcessBrowserTest { return kDefaultDebuggingPort; } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, base::IntToString(GetRemoteDebuggingPort())); diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index b0c8bf0..b1edbef 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc @@ -192,7 +192,7 @@ void DevToolsWindowBeforeUnloadObserver::BeforeUnloadFired( class DevToolsBeforeUnloadTest: public DevToolsSanityTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch( switches::kDisableHangMonitor); } @@ -289,7 +289,7 @@ class DevToolsBeforeUnloadTest: public DevToolsSanityTest { class DevToolsUnresponsiveBeforeUnloadTest: public DevToolsBeforeUnloadTest { public: - void SetUpCommandLine(CommandLine* command_line) override {} + void SetUpCommandLine(base::CommandLine* command_line) override {} }; void TimeoutCallback(const std::string& timeout_message) { @@ -391,7 +391,7 @@ class DevToolsExtensionTest : public DevToolsSanityTest, class DevToolsExperimentalExtensionTest : public DevToolsExtensionTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); } @@ -875,7 +875,8 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) { IN_PROC_BROWSER_TEST_F(WorkerDevToolsSanityTest, InspectSharedWorker) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -925,7 +926,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsAgentHostTest, TestAgentHostReleased) { } class RemoteDebuggingTest: public ExtensionApiTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222"); @@ -944,7 +945,8 @@ class RemoteDebuggingTest: public ExtensionApiTest { IN_PROC_BROWSER_TEST_F(RemoteDebuggingTest, MAYBE_RemoteDebugger) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 94de948..658ef41 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc @@ -335,8 +335,8 @@ GURL DevToolsUIBindings::ApplyThemeToURL(Profile* profile, SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_TOOLBAR)) + "&textColor=" + SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT))); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableDevToolsExperiments)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableDevToolsExperiments)) url_string += "&experiments=true"; #if defined(DEBUG_DEVTOOLS) url_string += "&debugFrontend=true"; diff --git a/chrome/browser/diagnostics/diagnostics_controller.cc b/chrome/browser/diagnostics/diagnostics_controller.cc index 4095535..c4c8c0d 100644 --- a/chrome/browser/diagnostics/diagnostics_controller.cc +++ b/chrome/browser/diagnostics/diagnostics_controller.cc @@ -58,7 +58,7 @@ void DiagnosticsController::RecordRegularStartup() { // This entry point is called from early in startup when very few things have // been initialized, so be careful what you use. -int DiagnosticsController::Run(const CommandLine& command_line, +int DiagnosticsController::Run(const base::CommandLine& command_line, DiagnosticsWriter* writer) { writer_ = writer; @@ -70,7 +70,7 @@ int DiagnosticsController::Run(const CommandLine& command_line, // This entry point is called from early in startup when very few things have // been initialized, so be careful what you use. -int DiagnosticsController::RunRecovery(const CommandLine& command_line, +int DiagnosticsController::RunRecovery(const base::CommandLine& command_line, DiagnosticsWriter* writer) { // Separate out recoveries that we execute automatically as a result of a // crash from user-run recoveries. diff --git a/chrome/browser/diagnostics/diagnostics_controller_unittest.cc b/chrome/browser/diagnostics/diagnostics_controller_unittest.cc index 617cc4e..9a349fc 100644 --- a/chrome/browser/diagnostics/diagnostics_controller_unittest.cc +++ b/chrome/browser/diagnostics/diagnostics_controller_unittest.cc @@ -24,7 +24,7 @@ namespace diagnostics { // run a test in. class DiagnosticsControllerTest : public testing::Test { protected: - DiagnosticsControllerTest() : cmdline_(CommandLine::NO_PROGRAM) {} + DiagnosticsControllerTest() : cmdline_(base::CommandLine::NO_PROGRAM) {} ~DiagnosticsControllerTest() override {} @@ -45,7 +45,7 @@ class DiagnosticsControllerTest : public testing::Test { PathService::Override(base::DIR_HOME, profile_dir_); #endif - cmdline_ = CommandLine(CommandLine::NO_PROGRAM); + cmdline_ = base::CommandLine(base::CommandLine::NO_PROGRAM); cmdline_.AppendSwitchPath(switches::kUserDataDir, profile_dir_); cmdline_.AppendSwitch(switches::kDiagnostics); cmdline_.AppendSwitch(switches::kDiagnosticsRecovery); @@ -70,7 +70,7 @@ class DiagnosticsControllerTest : public testing::Test { } scoped_ptr<DiagnosticsModel> model_; - CommandLine cmdline_; + base::CommandLine cmdline_; base::ScopedTempDir temp_dir_; scoped_ptr<DiagnosticsWriter> writer_; base::FilePath profile_dir_; diff --git a/chrome/browser/diagnostics/diagnostics_model.cc b/chrome/browser/diagnostics/diagnostics_model.cc index 0abb186..f210011 100644 --- a/chrome/browser/diagnostics/diagnostics_model.cc +++ b/chrome/browser/diagnostics/diagnostics_model.cc @@ -228,7 +228,7 @@ class DiagnosticsModelPosix : public DiagnosticsModelImpl { } // namespace -DiagnosticsModel* MakeDiagnosticsModel(const CommandLine& cmdline) { +DiagnosticsModel* MakeDiagnosticsModel(const base::CommandLine& cmdline) { base::FilePath user_data_dir = cmdline.GetSwitchValuePath(switches::kUserDataDir); if (!user_data_dir.empty()) diff --git a/chrome/browser/diagnostics/diagnostics_model_unittest.cc b/chrome/browser/diagnostics/diagnostics_model_unittest.cc index dd1ce5a..d8404db 100644 --- a/chrome/browser/diagnostics/diagnostics_model_unittest.cc +++ b/chrome/browser/diagnostics/diagnostics_model_unittest.cc @@ -14,9 +14,7 @@ namespace diagnostics { // Basic harness to acquire and release the Diagnostic model object. class DiagnosticsModelTest : public testing::Test { protected: - DiagnosticsModelTest() - : cmdline_(CommandLine::NO_PROGRAM) { - } + DiagnosticsModelTest() : cmdline_(base::CommandLine::NO_PROGRAM) {} ~DiagnosticsModelTest() override {} @@ -28,7 +26,7 @@ class DiagnosticsModelTest : public testing::Test { void TearDown() override { model_.reset(); } scoped_ptr<DiagnosticsModel> model_; - CommandLine cmdline_; + base::CommandLine cmdline_; DISALLOW_COPY_AND_ASSIGN(DiagnosticsModelTest); }; diff --git a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc index 6729ed2..4ad5f69 100644 --- a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc +++ b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc @@ -87,7 +87,7 @@ class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest { void TearDownOnMainThread() override { delete database_model_; } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableDomDistiller); } diff --git a/chrome/browser/dom_distiller/profile_utils.cc b/chrome/browser/dom_distiller/profile_utils.cc index 9564438..86b74ac 100644 --- a/chrome/browser/dom_distiller/profile_utils.cc +++ b/chrome/browser/dom_distiller/profile_utils.cc @@ -13,7 +13,8 @@ #include "components/dom_distiller/core/url_constants.h" void RegisterDomDistillerViewerSource(Profile* profile) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kEnableDomDistiller)) { dom_distiller::DomDistillerServiceFactory* dom_distiller_service_factory = dom_distiller::DomDistillerServiceFactory::GetInstance(); diff --git a/chrome/browser/dom_distiller/tab_utils_browsertest.cc b/chrome/browser/dom_distiller/tab_utils_browsertest.cc index 6620b6d..d8a5d13 100644 --- a/chrome/browser/dom_distiller/tab_utils_browsertest.cc +++ b/chrome/browser/dom_distiller/tab_utils_browsertest.cc @@ -32,7 +32,7 @@ const char* kSimpleArticlePath = "/dom_distiller/simple_article.html"; class DomDistillerTabUtilsBrowserTest : public InProcessBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableDomDistiller); } }; diff --git a/chrome/browser/domain_reliability/service_factory.cc b/chrome/browser/domain_reliability/service_factory.cc index 5b4f267..0bea9ed 100644 --- a/chrome/browser/domain_reliability/service_factory.cc +++ b/chrome/browser/domain_reliability/service_factory.cc @@ -22,7 +22,7 @@ namespace { const char* kDomainReliabilityUploadReporterString = "chrome"; bool IsDomainReliabilityMonitoringEnabled() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kDisableDomainReliability)) return false; if (command_line->HasSwitch(switches::kEnableDomainReliability)) diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 66fd11c..b3884ed 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -454,7 +454,7 @@ class DownloadTest : public InProcessBrowserTest { file_activity_observer_.reset(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kDisablePluginsDiscovery); } @@ -1824,7 +1824,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryDangerCheck) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -2878,7 +2879,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, HiddenDownload) { IN_PROC_BROWSER_TEST_F(DownloadTest, TestMultipleDownloadsInfobar) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -3169,7 +3171,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadPrefs_SaveFilePath) { // A download that is interrupted due to a file error should be able to be // resumed. IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_NoPrompt) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); scoped_refptr<content::TestFileErrorInjector> error_injector( content::TestFileErrorInjector::Create( @@ -3194,7 +3196,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_NoPrompt) { // path is invalid or unusable should cause a prompt to be displayed on // resumption. IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_WithPrompt) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); scoped_refptr<content::TestFileErrorInjector> error_injector( content::TestFileErrorInjector::Create( @@ -3218,7 +3220,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_WithPrompt) { // The user shouldn't be prompted on a resumed download unless a prompt is // necessary due to the interrupt reason. IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_WithPromptAlways) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); browser()->profile()->GetPrefs()->SetBoolean( prefs::kPromptForDownload, true); @@ -3248,7 +3250,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_WithPromptAlways) { // A download that is interrupted due to a transient error should be resumed // automatically. IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_Automatic) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); scoped_refptr<content::TestFileErrorInjector> error_injector( content::TestFileErrorInjector::Create( @@ -3268,7 +3270,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_Automatic) { // An interrupting download should be resumable multiple times. IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_MultipleAttempts) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); scoped_refptr<content::TestFileErrorInjector> error_injector( content::TestFileErrorInjector::Create( diff --git a/chrome/browser/download/save_package_file_picker.cc b/chrome/browser/download/save_package_file_picker.cc index b3b8a15..cd70d40 100644 --- a/chrome/browser/download/save_package_file_picker.cc +++ b/chrome/browser/download/save_package_file_picker.cc @@ -115,8 +115,8 @@ void AddCompleteFileTypeInfo( bool SavePackageFilePicker::ShouldSaveAsMHTML() const { #if !defined(OS_CHROMEOS) - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kSavePageAsMHTML)) + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSavePageAsMHTML)) return false; #endif return can_save_as_complete_; diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index 4a784bf..b3e3b58 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -749,7 +749,7 @@ class SavePageAsMHTMLBrowserTest : public SavePageBrowserTest { public: SavePageAsMHTMLBrowserTest() {} ~SavePageAsMHTMLBrowserTest() override; - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kSavePageAsMHTML); } diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index 7347c89..289898b 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -297,7 +297,7 @@ class ErrorPageTest : public InProcessBrowserTest { // Navigates the active tab to a mock url created for the file at |file_path|. // Needed for StaleCacheStatus and StaleCacheStatusFailedCorrections tests. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache); } @@ -874,7 +874,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, StaleCacheStatus) { class ErrorPageAutoReloadTest : public InProcessBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableOfflineAutoReload); } diff --git a/chrome/browser/extensions/activity_log/activity_database.cc b/chrome/browser/extensions/activity_log/activity_database.cc index 286f24e..d8c65e4 100644 --- a/chrome/browser/extensions/activity_log/activity_database.cc +++ b/chrome/browser/extensions/activity_log/activity_database.cc @@ -43,7 +43,7 @@ ActivityDatabase::ActivityDatabase(ActivityDatabase::Delegate* delegate) batch_mode_(true), already_closed_(false), did_init_(false) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogTesting)) { batching_period_ = base::TimeDelta::FromSeconds(10); } else { diff --git a/chrome/browser/extensions/activity_log/activity_database_unittest.cc b/chrome/browser/extensions/activity_log/activity_database_unittest.cc index da4bc2e..3944384 100644 --- a/chrome/browser/extensions/activity_log/activity_database_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_database_unittest.cc @@ -112,8 +112,8 @@ class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness { #if defined OS_CHROMEOS test_user_manager_.reset(new chromeos::ScopedTestUserManager()); #endif - CommandLine command_line(CommandLine::NO_PROGRAM); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogTesting); } diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc index 849bc86..509393f 100644 --- a/chrome/browser/extensions/activity_log/activity_log.cc +++ b/chrome/browser/extensions/activity_log/activity_log.cc @@ -360,8 +360,8 @@ ActivityLog::ActivityLog(content::BrowserContext* context) extension_registry_observer_(this), watchdog_apps_active_(0) { // This controls whether logging statements are printed & which policy is set. - testing_mode_ = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableExtensionActivityLogTesting); + testing_mode_ = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExtensionActivityLogTesting); // Check if the watchdog extension is previously installed and active. watchdog_apps_active_ = @@ -377,10 +377,10 @@ ActivityLog::ActivityLog(content::BrowserContext* context) has_threads_ = false; } - db_enabled_ = has_threads_ - && (CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableExtensionActivityLogging) - || watchdog_apps_active_); + db_enabled_ = + has_threads_ && (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExtensionActivityLogging) || + watchdog_apps_active_); ExtensionSystem::Get(profile_)->ready().Post( FROM_HERE, @@ -480,7 +480,7 @@ void ActivityLog::OnExtensionUnloaded(content::BrowserContext* browser_context, profile_->GetPrefs()->SetInteger(prefs::kWatchdogExtensionActive, watchdog_apps_active_); if (watchdog_apps_active_ == 0 && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogging)) { db_enabled_ = false; } @@ -492,7 +492,7 @@ void ActivityLog::OnExtensionUninstalled( const Extension* extension, extensions::UninstallReason reason) { if (ActivityLogAPI::IsExtensionWhitelisted(extension->id()) && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogging) && watchdog_apps_active_ == 0) { DeleteDatabase(); diff --git a/chrome/browser/extensions/activity_log/activity_log_browsertest.cc b/chrome/browser/extensions/activity_log/activity_log_browsertest.cc index 2846405..cc59740 100644 --- a/chrome/browser/extensions/activity_log/activity_log_browsertest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_browsertest.cc @@ -29,7 +29,7 @@ namespace extensions { class ActivityLogPrerenderTest : public ExtensionApiTest { protected: // Make sure the activity log is turned on. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); command_line->AppendSwitchASCII(switches::kPrerenderMode, diff --git a/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc index ebdca47..8c77afd 100644 --- a/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc @@ -69,12 +69,12 @@ TEST_F(ActivityLogEnabledTest, CommandLineSwitch) { scoped_ptr<TestingProfile> profile2( static_cast<TestingProfile*>(CreateBrowserContext())); - CommandLine command_line(CommandLine::NO_PROGRAM); - CommandLine saved_cmdline_ = *CommandLine::ForCurrentProcess(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + base::CommandLine saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogging); ActivityLog* activity_log1 = ActivityLog::GetInstance(profile1.get()); - *CommandLine::ForCurrentProcess() = saved_cmdline_; + *base::CommandLine::ForCurrentProcess() = saved_cmdline_; ActivityLog* activity_log2 = ActivityLog::GetInstance(profile2.get()); EXPECT_EQ(0, @@ -123,7 +123,7 @@ TEST_F(ActivityLogEnabledTest, PrefSwitch) { } TEST_F(ActivityLogEnabledTest, WatchdogSwitch) { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); scoped_ptr<TestingProfile> profile1( static_cast<TestingProfile*>(CreateBrowserContext())); scoped_ptr<TestingProfile> profile2( @@ -228,9 +228,9 @@ TEST_F(ActivityLogEnabledTest, WatchdogSwitch) { TEST_F(ActivityLogEnabledTest, AppAndCommandLine) { // Set the command line switch. - CommandLine command_line(CommandLine::NO_PROGRAM); - CommandLine saved_cmdline_ = *CommandLine::ForCurrentProcess(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + base::CommandLine saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogging); scoped_ptr<TestingProfile> profile( @@ -280,7 +280,7 @@ TEST_F(ActivityLogEnabledTest, AppAndCommandLine) { EXPECT_FALSE(activity_log->IsWatchdogAppActive()); // Cleanup. - *CommandLine::ForCurrentProcess() = saved_cmdline_; + *base::CommandLine::ForCurrentProcess() = saved_cmdline_; } } // namespace extensions diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc index bf43068..13cdb1d 100644 --- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc @@ -61,10 +61,10 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness { #if defined OS_CHROMEOS test_user_manager_.reset(new chromeos::ScopedTestUserManager()); #endif - CommandLine command_line(CommandLine::NO_PROGRAM); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogging); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogTesting); extension_service_ = static_cast<TestExtensionSystem*>( ExtensionSystem::Get(profile()))->CreateExtensionService diff --git a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc index 847260c..e52a03c 100644 --- a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc +++ b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc @@ -38,14 +38,14 @@ class CountingPolicyTest : public testing::Test { public: CountingPolicyTest() : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), - saved_cmdline_(CommandLine::NO_PROGRAM) { + saved_cmdline_(base::CommandLine::NO_PROGRAM) { #if defined OS_CHROMEOS test_user_manager_.reset(new chromeos::ScopedTestUserManager()); #endif - CommandLine command_line(CommandLine::NO_PROGRAM); - saved_cmdline_ = *CommandLine::ForCurrentProcess(); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); profile_.reset(new TestingProfile()); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogging); extension_service_ = static_cast<TestExtensionSystem*>( ExtensionSystem::Get(profile_.get()))->CreateExtensionService @@ -60,7 +60,7 @@ class CountingPolicyTest : public testing::Test { profile_.reset(NULL); base::RunLoop().RunUntilIdle(); // Restore the original command line and undo the affects of SetUp(). - *CommandLine::ForCurrentProcess() = saved_cmdline_; + *base::CommandLine::ForCurrentProcess() = saved_cmdline_; } // Wait for the task queue for the specified thread to empty. @@ -526,7 +526,7 @@ class CountingPolicyTest : public testing::Test { // The test framework will do this itself as well. However, by then, // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in // TearDown(). - CommandLine saved_cmdline_; + base::CommandLine saved_cmdline_; #if defined OS_CHROMEOS chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc index 56115aa..dae2af6 100644 --- a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc +++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc @@ -37,16 +37,16 @@ class FullStreamUIPolicyTest : public testing::Test { public: FullStreamUIPolicyTest() : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), - saved_cmdline_(CommandLine::NO_PROGRAM) { + saved_cmdline_(base::CommandLine::NO_PROGRAM) { #if defined OS_CHROMEOS test_user_manager_.reset(new chromeos::ScopedTestUserManager()); #endif - CommandLine command_line(CommandLine::NO_PROGRAM); - saved_cmdline_ = *CommandLine::ForCurrentProcess(); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); profile_.reset(new TestingProfile()); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogging); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExtensionActivityLogTesting); extension_service_ = static_cast<TestExtensionSystem*>( ExtensionSystem::Get(profile_.get()))->CreateExtensionService @@ -61,7 +61,7 @@ class FullStreamUIPolicyTest : public testing::Test { profile_.reset(NULL); base::RunLoop().RunUntilIdle(); // Restore the original command line and undo the affects of SetUp(). - *CommandLine::ForCurrentProcess() = saved_cmdline_; + *base::CommandLine::ForCurrentProcess() = saved_cmdline_; } // A wrapper function for CheckReadFilteredData, so that we don't need to @@ -443,7 +443,7 @@ class FullStreamUIPolicyTest : public testing::Test { // The test framework will do this itself as well. However, by then, // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in // TearDown(). - CommandLine saved_cmdline_; + base::CommandLine saved_cmdline_; #if defined OS_CHROMEOS chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; diff --git a/chrome/browser/extensions/all_urls_apitest.cc b/chrome/browser/extensions/all_urls_apitest.cc index b251d72..c29611c 100644 --- a/chrome/browser/extensions/all_urls_apitest.cc +++ b/chrome/browser/extensions/all_urls_apitest.cc @@ -28,7 +28,8 @@ typedef ExtensionApiTest AllUrlsApiTest; IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, MAYBE_WhitelistedExtension) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc b/chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc index 5b05b62..126ce54 100644 --- a/chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc +++ b/chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc @@ -21,16 +21,16 @@ namespace extensions { class ActivityLogApiTest : public ExtensionApiTest { public: - ActivityLogApiTest() : saved_cmdline_(CommandLine::NO_PROGRAM) {} + ActivityLogApiTest() : saved_cmdline_(base::CommandLine::NO_PROGRAM) {} ~ActivityLogApiTest() override { ExtensionApiTest::SetUpCommandLine(&saved_cmdline_); - *CommandLine::ForCurrentProcess() = saved_cmdline_; + *base::CommandLine::ForCurrentProcess() = saved_cmdline_; } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); - saved_cmdline_ = *CommandLine::ForCurrentProcess(); + saved_cmdline_ = *base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); } @@ -43,7 +43,7 @@ class ActivityLogApiTest : public ExtensionApiTest { } private: - CommandLine saved_cmdline_; + base::CommandLine saved_cmdline_; }; #if defined(OS_WIN) && !defined(NDEBUG) diff --git a/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc b/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc index e13e2bb31..eba236a 100644 --- a/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc +++ b/chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc @@ -268,7 +268,7 @@ IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, DisplayStateChanges) { class BrailleDisplayPrivateAPIUserTest : public BrailleDisplayPrivateApiTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kLoginManager); command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, TestingProfile::kTestUserProfileDir); diff --git a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc index 21d8828..b8c5356 100644 --- a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc +++ b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc @@ -37,7 +37,7 @@ namespace extensions { class CastStreamingApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, @@ -321,7 +321,7 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest { CastStreamingApiTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(::switches::kWindowSize, "128,128"); CastStreamingApiTest::SetUpCommandLine(command_line); } diff --git a/chrome/browser/extensions/api/cast_streaming/performance_test.cc b/chrome/browser/extensions/api/cast_streaming/performance_test.cc index 2be63ec..9f57dcb 100644 --- a/chrome/browser/extensions/api/cast_streaming/performance_test.cc +++ b/chrome/browser/extensions/api/cast_streaming/performance_test.cc @@ -292,7 +292,7 @@ class CastV2PerformanceTest } bool IsGpuAvailable() const { - return CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); + return base::CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); } std::string GetSuffixForTestFlags() { @@ -354,7 +354,7 @@ class CastV2PerformanceTest ExtensionApiTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { // Some of the tests may launch http requests through JSON or AJAX // which causes a security error (cross domain request) when the page // is loaded from the local file system ( file:// ). The following switch diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc index 19a8041..5b42854 100644 --- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc +++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc @@ -22,7 +22,7 @@ using ::testing::_; // A base class for tests below. class ExtensionCloudPrintPrivateApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( switches::kCloudPrintURL, diff --git a/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc b/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc index 52586c5d..37bef4e 100644 --- a/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc +++ b/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc @@ -32,7 +32,7 @@ bool CommandLinePrivateHasSwitchFunction::RunSync() { } results_ = command_line_private::HasSwitch::Results::Create( - CommandLine::ForCurrentProcess()->HasSwitch(params->name)); + base::CommandLine::ForCurrentProcess()->HasSwitch(params->name)); return true; } diff --git a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc index bb4e217..9bc60511 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc @@ -34,7 +34,7 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest { public: ExtensionContentSettingsApiTest() : profile_(NULL) {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kDisablePluginsDiscovery); } diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index 811d5dd..f927fcb 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc @@ -586,8 +586,8 @@ bool DebuggerAttachFunction::RunAsync() { } infobars::InfoBar* infobar = NULL; - if (!CommandLine::ForCurrentProcess()-> - HasSwitch(::switches::kSilentDebuggerExtensionAPI)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kSilentDebuggerExtensionAPI)) { // Do not attach to the target if for any reason the infobar cannot be shown // for this WebContents instance. infobar = ExtensionDevToolsInfoBarDelegate::Create( diff --git a/chrome/browser/extensions/api/debugger/debugger_extension_apitest.cc b/chrome/browser/extensions/api/debugger/debugger_extension_apitest.cc index fca215b..a8a3ef8 100644 --- a/chrome/browser/extensions/api/debugger/debugger_extension_apitest.cc +++ b/chrome/browser/extensions/api/debugger/debugger_extension_apitest.cc @@ -9,7 +9,7 @@ class ExtensionApiTestWithSwitch : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kSilentDebuggerExtensionAPI); command_line->AppendSwitch(extensions::switches::kExtensionsOnChromeURLs); diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc index 3ddab86..f1751ff 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc @@ -106,7 +106,7 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunAsync() { return false; } - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAllowHttpScreenCapture) && !origin_.SchemeIsSecure()) { error_ = kTabUrlNotSecure; diff --git a/chrome/browser/extensions/api/dial/dial_apitest.cc b/chrome/browser/extensions/api/dial/dial_apitest.cc index 3dceb944..c4f20f1 100644 --- a/chrome/browser/extensions/api/dial/dial_apitest.cc +++ b/chrome/browser/extensions/api/dial/dial_apitest.cc @@ -25,7 +25,7 @@ class DialAPITest : public ExtensionApiTest { public: DialAPITest() {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc index 82b5e9f..0c09805 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc @@ -3858,7 +3858,7 @@ IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F( DownloadExtensionTest, MAYBE_DownloadExtensionTest_OnDeterminingFilename_InterruptedResume) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); LoadExtension("downloads_split"); ASSERT_TRUE(StartEmbeddedTestServer()); diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc index bb47bd6..b5975a3 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc @@ -168,7 +168,7 @@ class EnterprisePlatformKeysTest public: EnterprisePlatformKeysTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Enable the WebCrypto API. diff --git a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc index 9f7e301..b166f4c 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc @@ -36,7 +36,7 @@ class FeedbackTest : public ExtensionBrowserTest { InProcessBrowserTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(::switches::kEnableUserMediaScreenCapturing); InProcessBrowserTest::SetUpCommandLine(command_line); } diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc index 9b60f91..a9cadbc 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc @@ -64,7 +64,7 @@ const int kGraylistedPath = base::DIR_HOME; class FileSystemApiTest : public PlatformAppBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { PlatformAppBrowserTest::SetUpCommandLine(command_line); test_root_folder_ = test_data_dir_.AppendASCII("api_test") .AppendASCII("file_system"); diff --git a/chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc b/chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc index 9f99360..3eee978 100644 --- a/chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc +++ b/chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc @@ -228,7 +228,7 @@ class GcdPrivateAPITest : public ExtensionApiTest { #endif // ENABLE_MDNS } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/extensions/api/gcm/gcm_apitest.cc b/chrome/browser/extensions/api/gcm/gcm_apitest.cc index fdd057b..d72b7f2 100644 --- a/chrome/browser/extensions/api/gcm/gcm_apitest.cc +++ b/chrome/browser/extensions/api/gcm/gcm_apitest.cc @@ -61,7 +61,7 @@ class GcmApiTest : public ExtensionApiTest { GcmApiTest() : fake_gcm_profile_service_(NULL) {} protected: - void SetUpCommandLine(CommandLine* command_line) override; + void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; void StartCollecting(); @@ -74,7 +74,7 @@ class GcmApiTest : public ExtensionApiTest { gcm::FakeGCMProfileService* fake_gcm_profile_service_; }; -void GcmApiTest::SetUpCommandLine(CommandLine* command_line) { +void GcmApiTest::SetUpCommandLine(base::CommandLine* command_line) { // We now always create the GCMProfileService instance in // ProfileSyncServiceFactory that is called when a profile is being // initialized. In order to prevent it from being created, we add the switch diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index 196ecaa..7e2ca23 100644 --- a/chrome/browser/extensions/api/history/history_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc @@ -398,7 +398,7 @@ bool HistoryDeleteUrlFunction::RunAsync() { // Also clean out from the activity log. If the activity log testing flag is // set then don't clean so testers can see what potentially malicious // extensions have been trying to clean from their logs. - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogTesting)) { ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); DCHECK(activity_log); @@ -431,7 +431,7 @@ bool HistoryDeleteRangeFunction::RunAsyncImpl() { &task_tracker_); // Also clean from the activity log unless in testing mode. - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogTesting)) { ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); DCHECK(activity_log); @@ -461,7 +461,7 @@ bool HistoryDeleteAllFunction::RunAsyncImpl() { &task_tracker_); // Also clean from the activity log unless in testing mode. - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExtensionActivityLogTesting)) { ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); DCHECK(activity_log); diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index a2881ef..2ef6278 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -401,7 +401,7 @@ gaia::AccountIds CreateIds(std::string email, std::string obfid) { } class IdentityGetAccountsFunctionTest : public ExtensionBrowserTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kExtensionsMultiAccount); } @@ -513,7 +513,7 @@ IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, TwoAccountsSignedIn) { class IdentityOldProfilesGetAccountsFunctionTest : public IdentityGetAccountsFunctionTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { // Don't add the multi-account switch that parent class would have. } }; @@ -657,7 +657,7 @@ IN_PROC_BROWSER_TEST_F(IdentityGetProfileUserInfoFunctionTest, class GetAuthTokenFunctionTest : public IdentityTestWithSignin { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { IdentityTestWithSignin::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kExtensionsMultiAccount); } @@ -861,7 +861,8 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest, SignIn("primary@example.com"); #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -885,7 +886,8 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest, SignIn("primary@example.com"); #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -1662,7 +1664,7 @@ IN_PROC_BROWSER_TEST_F(RemoveCachedAuthTokenFunctionTest, MatchingToken) { class LaunchWebAuthFlowFunctionTest : public AsyncExtensionBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { AsyncExtensionBrowserTest::SetUpCommandLine(command_line); // Reduce performance test variance by disabling background networking. command_line->AppendSwitch(switches::kDisableBackgroundNetworking); @@ -1742,7 +1744,8 @@ IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, LoadFailed) { IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, NonInteractiveSuccess) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -1768,7 +1771,8 @@ IN_PROC_BROWSER_TEST_F( LaunchWebAuthFlowFunctionTest, InteractiveFirstNavigationSuccess) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc index dc508a8..0b6670e 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc +++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc @@ -93,7 +93,7 @@ void CollectLogInfo( // Returns directory location of app-specific logs that are initiated with // logPrivate.startEventRecorder() calls - /home/chronos/user/log/apps base::FilePath GetAppLogDirectory() { - return logging::GetSessionLogDir(*CommandLine::ForCurrentProcess()) + return logging::GetSessionLogDir(*base::CommandLine::ForCurrentProcess()) .Append(kAppLogsSubdir); } diff --git a/chrome/browser/extensions/api/management/management_apitest.cc b/chrome/browser/extensions/api/management/management_apitest.cc index 7820666..9b0f132 100644 --- a/chrome/browser/extensions/api/management/management_apitest.cc +++ b/chrome/browser/extensions/api/management/management_apitest.cc @@ -43,7 +43,7 @@ Browser* FindOtherBrowser(Browser* browser) { class ExtensionManagementApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnablePanels); } diff --git a/chrome/browser/extensions/api/mdns/mdns_apitest.cc b/chrome/browser/extensions/api/mdns/mdns_apitest.cc index 00d3d8d..5365518 100644 --- a/chrome/browser/extensions/api/mdns/mdns_apitest.cc +++ b/chrome/browser/extensions/api/mdns/mdns_apitest.cc @@ -42,7 +42,7 @@ class MDnsAPITest : public ExtensionApiTest { public: MDnsAPITest() {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc index 8a00c01..1cffad6 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc @@ -441,7 +441,7 @@ class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { class MediaGalleriesPlatformAppPpapiTest : public MediaGalleriesPlatformAppBrowserTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { MediaGalleriesPlatformAppBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnablePepperTesting); } @@ -476,7 +476,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppPpapiTest, SendFilesystem) { AppLaunchParams params(browser()->profile(), extension, extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, extensions::SOURCE_TEST); - params.command_line = *CommandLine::ForCurrentProcess(); + params.command_line = *base::CommandLine::ForCurrentProcess(); OpenApplication(params); bool result = true; diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_watch_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_watch_apitest.cc index 6eede09..1f8e767 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_watch_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_watch_apitest.cc @@ -81,7 +81,7 @@ class MediaGalleriesGalleryWatchApiTest : public ExtensionApiTest { protected: // ExtensionApiTest overrides. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, kTestExtensionId); diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc index 95340cf..77d6efb 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc @@ -77,7 +77,7 @@ class MediaGalleriesPrivateGalleryWatchApiTest : public ExtensionApiTest { protected: // ExtensionApiTest overrides. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.cc b/chrome/browser/extensions/api/messaging/native_process_launcher.cc index 14c01fb..5fd487d 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.cc @@ -182,7 +182,7 @@ void NativeProcessLauncherImpl::Core::DoLaunchOnThreadPool( return; } - CommandLine command_line(host_path); + base::CommandLine command_line(host_path); command_line.AppendArg(origin.spec()); // Pass handle of the native view window to the native messaging host. This diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc index bd2b316..073b274 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc @@ -49,7 +49,7 @@ base::FilePath NativeProcessLauncher::FindManifest( // static bool NativeProcessLauncher::LaunchNativeProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, base::Process* process, base::File* read_file, base::File* write_file) { diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc index d0ae6ed..0514e78 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc @@ -88,7 +88,7 @@ base::FilePath NativeProcessLauncher::FindManifest( // static bool NativeProcessLauncher::LaunchNativeProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, base::Process* process, base::File* read_file, base::File* write_file) { diff --git a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc index 8b50bd7..269931e 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc @@ -249,7 +249,7 @@ class NetworkingPrivateApiTest : public ExtensionApiTest { return s_test_delegate_; } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Whitelist the extension ID of the test extension. command_line->AppendSwitchASCII( diff --git a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc index a2b706e..3ec65f4 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc @@ -123,7 +123,7 @@ class NetworkingPrivateChromeOSApiTest : public ExtensionApiTest { *out = result; } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Whitelist the extension ID of the test extension. command_line->AppendSwitchASCII( diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc index eebc2d3..c2e0d02 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc @@ -74,7 +74,7 @@ class NetworkingPrivateServiceClientApiTest : public ExtensionApiTest { kFlagEnableFileAccess | kFlagLoadAsComponent); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Whitelist the extension ID of the test extension. command_line->AppendSwitchASCII( diff --git a/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc b/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc index 73b0302..295c303 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_apitest.cc @@ -14,7 +14,7 @@ using extensions::PageCaptureSaveAsMHTMLFunction; class ExtensionPageCaptureApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); } diff --git a/chrome/browser/extensions/api/permissions/permissions_apitest.cc b/chrome/browser/extensions/api/permissions/permissions_apitest.cc index 7b6a35b..9b98072 100644 --- a/chrome/browser/extensions/api/permissions/permissions_apitest.cc +++ b/chrome/browser/extensions/api/permissions/permissions_apitest.cc @@ -27,7 +27,7 @@ static void AddPattern(URLPatternSet* extent, const std::string& pattern) { class ExperimentalApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); } diff --git a/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc b/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc index 0c82f6e..f705296 100644 --- a/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc +++ b/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc @@ -111,7 +111,7 @@ class PreferencesPrivateApiTest : public ExtensionApiTest { PreferencesPrivateApiTest() : browser_(NULL), service_(NULL) {} ~PreferencesPrivateApiTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { #if defined(OS_CHROMEOS) command_line->AppendSwitch( chromeos::switches::kIgnoreUserProfileMappingForTests); diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc index 26551fc..774066c 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc @@ -73,7 +73,7 @@ class PushMessagingApiTest : public ExtensionApiTest { : fake_invalidation_service_(NULL) { } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); } diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc index af48842..97698f6 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc @@ -39,7 +39,7 @@ class PushMessagingCanaryTest : public ExtensionApiTest { ~PushMessagingCanaryTest() override {} void SetUp() override { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); ASSERT_TRUE(command_line->HasSwitch(kPasswordFileForTest)); base::FilePath password_file = diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc index f5d39d28..9c1b39c 100644 --- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc +++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc @@ -36,7 +36,7 @@ class ScreenlockPrivateApiTest : public ExtensionApiTest, ~ScreenlockPrivateApiTest() override {} // ExtensionApiTest - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, kTestExtensionId); diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc index cccb653..deec064 100644 --- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc +++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc @@ -85,7 +85,7 @@ void BuildTabSpecifics(const std::string& tag, class ExtensionSessionsTest : public InProcessBrowserTest { public: - void SetUpCommandLine(CommandLine* command_line) override; + void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; protected: @@ -108,7 +108,7 @@ class ExtensionSessionsTest : public InProcessBrowserTest { scoped_refptr<Extension> extension_; }; -void ExtensionSessionsTest::SetUpCommandLine(CommandLine* command_line) { +void ExtensionSessionsTest::SetUpCommandLine(base::CommandLine* command_line) { #if defined(OS_CHROMEOS) command_line->AppendSwitch( chromeos::switches::kIgnoreUserProfileMappingForTests); @@ -384,7 +384,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionSessionsTest, GetRecentlyClosedIncognito) { IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_SessionsApis) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc index cfa85fd..c086f7b 100644 --- a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc +++ b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc @@ -244,7 +244,8 @@ class StreamsPrivateApiTest : public ExtensionApiTest { IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -274,7 +275,8 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) { IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, FileURL) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -304,7 +306,8 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, FileURL) { IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, NavigateCrossSite) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -434,7 +437,8 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, DirectDownload) { IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Headers) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -463,7 +467,8 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Headers) { IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Abort) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc index 4c2e996..1f24b9a 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc @@ -89,7 +89,7 @@ bool TabCaptureCaptureFunction::RunSync() { if (!extension()->permissions_data()->HasAPIPermissionForTab( SessionTabHelper::IdForTab(target_contents), APIPermission::kTabCaptureForTab) && - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kWhitelistedExtensionID) != extension_id && !SimpleFeature::IsIdInList( extension_id, diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc index 118b340..7908329 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc @@ -36,7 +36,7 @@ const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; class TabCaptureApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Specify smallish window size to make testing of tab capture less CPU // intensive. @@ -44,7 +44,7 @@ class TabCaptureApiTest : public ExtensionApiTest { } void AddExtensionToCommandLineWhitelist() { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kWhitelistedExtensionID, kExtensionId); } @@ -82,7 +82,7 @@ class TabCaptureApiPixelTest : public TabCaptureApiTest { // TODO(miu): Look into enabling these tests for the Debug build bots once // they prove to be stable again on the Release bots. // http://crbug.com/396413 - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( "run-tab-capture-api-pixel-tests"); #endif } diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc index e289d79..6213411 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc @@ -62,7 +62,7 @@ class TabCapturePerformanceTest } bool IsGpuAvailable() const { - return CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); + return base::CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); } std::string ScalingMethod() const { @@ -100,7 +100,7 @@ class TabCapturePerformanceTest ExtensionApiTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { if (!ScalingMethod().empty()) { command_line->AppendSwitchASCII(switches::kTabCaptureUpscaleQuality, ScalingMethod()); diff --git a/chrome/browser/extensions/api/terminal/terminal_private_apitest.cc b/chrome/browser/extensions/api/terminal/terminal_private_apitest.cc index 2039685..c7b7cab 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_apitest.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_apitest.cc @@ -7,7 +7,7 @@ #include "extensions/common/switches.h" class ExtensionTerminalPrivateApiTest : public ExtensionApiTest { - virtual void SetUpCommandLine(CommandLine* command_line) override { + virtual void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc index 224ca0d..4ef8e00 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc @@ -85,7 +85,7 @@ bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) { bool ChromeVirtualKeyboardDelegate::MoveCursor(int swipe_direction, int modifier_flags) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( keyboard::switches::kEnableSwipeSelection)) { return false; } diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc index 17cbd05..3d691e3 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc @@ -261,7 +261,7 @@ class WebNavigationApiTest : public ExtensionApiTest { FrameNavigationState::set_allow_extension_scheme(true); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAllowLegacyExtensionManifests); host_resolver()->AddRule("*", "127.0.0.1"); diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc index d429cd1..b96d23e 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc @@ -96,7 +96,7 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest { ExtensionWebstorePrivateApiTest() {} ~ExtensionWebstorePrivateApiTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII( switches::kAppsGalleryURL, @@ -155,7 +155,7 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest { return true; #else GURL crx_url = GetTestServerURL(crx_file); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryUpdateURL, crx_url.spec()); GURL page_url = GetTestServerURL(page); @@ -407,7 +407,7 @@ class EphemeralAppWebstorePrivateApiTest "http://www.example.com:%d/files/extensions/platform_apps/" "ephemeral_launcher", host_port.port()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryURL, test_gallery_url); } @@ -421,16 +421,16 @@ class EphemeralAppWebstorePrivateApiTest // Run tests when the --enable-ephemeral-apps switch is not enabled. IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, EphemeralAppsFeatureDisabled) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( app_list::switches::kDisableExperimentalAppList); ASSERT_TRUE(RunInstallTest("webstore_launch_disabled.html", "app.crx")); } // Run tests when the --enable-ephemeral-apps switch is enabled. IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, LaunchEphemeralApp) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableEphemeralAppsInWebstore); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( app_list::switches::kEnableExperimentalAppList); ASSERT_TRUE(RunInstallTest("webstore_launch_app.html", "app.crx")); } diff --git a/chrome/browser/extensions/app_background_page_apitest.cc b/chrome/browser/extensions/app_background_page_apitest.cc index c0bbe07..3b5a0e7 100644 --- a/chrome/browser/extensions/app_background_page_apitest.cc +++ b/chrome/browser/extensions/app_background_page_apitest.cc @@ -42,7 +42,7 @@ using extensions::Extension; class AppBackgroundPageApiTest : public ExtensionApiTest { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kDisablePopupBlocking); command_line->AppendSwitch(extensions::switches::kAllowHTTPBackgroundPage); diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index 731cded..a189991 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -57,11 +57,11 @@ class AppApiTest : public ExtensionApiTest { } // Pass flags to make testing apps easier. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisablePopupBlocking); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kAllowHTTPBackgroundPage); } @@ -134,9 +134,9 @@ class AppApiTest : public ExtensionApiTest { // Omits the disable-popup-blocking flag so we can cover that case. class BlockedAppApiTest : public AppApiTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kAllowHTTPBackgroundPage); } }; @@ -599,7 +599,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcessWithJavaScript) { IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/background_app_browsertest.cc b/chrome/browser/extensions/background_app_browsertest.cc index 260ef435..020953d 100644 --- a/chrome/browser/extensions/background_app_browsertest.cc +++ b/chrome/browser/extensions/background_app_browsertest.cc @@ -9,7 +9,7 @@ class TestBackgroundModeManager : public BackgroundModeManager { public: - TestBackgroundModeManager(CommandLine* command_line, + TestBackgroundModeManager(base::CommandLine* command_line, ProfileInfoCache* profile_cache) : BackgroundModeManager(command_line, profile_cache), showed_background_app_installed_notification_for_test_(false) {} @@ -50,7 +50,7 @@ IN_PROC_BROWSER_TEST_F(BackgroundAppBrowserTest, ReloadBackgroundApp) { // Pass this in to the browser test. scoped_ptr<BackgroundModeManager> test_background_mode_manager( new TestBackgroundModeManager( - CommandLine::ForCurrentProcess(), + base::CommandLine::ForCurrentProcess(), &(g_browser_process->profile_manager()->GetProfileInfoCache()))); g_browser_process->set_background_mode_manager_for_test( test_background_mode_manager.Pass()); diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc index d492229..b29fb53 100644 --- a/chrome/browser/extensions/bundle_installer.cc +++ b/chrome/browser/extensions/bundle_installer.cc @@ -95,7 +95,7 @@ const int kHeadingIds[3][4] = { // static void BundleInstaller::SetAutoApproveForTesting(bool auto_approve) { - CHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)); + CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)); g_auto_approve_for_test = auto_approve ? PROCEED : ABORT; } diff --git a/chrome/browser/extensions/chrome_app_api_browsertest.cc b/chrome/browser/extensions/chrome_app_api_browsertest.cc index 92c02c9..d85b539 100644 --- a/chrome/browser/extensions/chrome_app_api_browsertest.cc +++ b/chrome/browser/extensions/chrome_app_api_browsertest.cc @@ -87,7 +87,7 @@ class ChromeAppAPITest : public ExtensionBrowserTest { base::Bind(&content::FrameIsChildOfMainFrame)); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kAppsCheckoutURL, "http://checkout.com:"); diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc index 084ffd3..7ac6961 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc @@ -62,7 +62,7 @@ bool ChromeExtensionsBrowserClient::IsShuttingDown() { } bool ChromeExtensionsBrowserClient::AreExtensionsDisabled( - const CommandLine& command_line, + const base::CommandLine& command_line, content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); return command_line.HasSwitch(switches::kDisableExtensions) || @@ -176,7 +176,7 @@ bool ChromeExtensionsBrowserClient::DidVersionUpdate( return false; // If we're inside a browser test, then assume prefs are all up-to-date. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) return false; PrefService* pref_service = extension_prefs->pref_service(); @@ -281,7 +281,7 @@ ExtensionCache* ChromeExtensionsBrowserClient::GetExtensionCache() { } bool ChromeExtensionsBrowserClient::IsBackgroundUpdateAllowed() { - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableBackgroundNetworking); } diff --git a/chrome/browser/extensions/chrome_process_manager_delegate.cc b/chrome/browser/extensions/chrome_process_manager_delegate.cc index a155b77b..df440fb 100644 --- a/chrome/browser/extensions/chrome_process_manager_delegate.cc +++ b/chrome/browser/extensions/chrome_process_manager_delegate.cc @@ -62,7 +62,8 @@ bool ChromeProcessManagerDelegate::DeferCreatingStartupBackgroundHosts( // started to show the app launcher. Background hosts will be loaded later // via NOTIFICATION_BROWSER_WINDOW_READY. http://crbug.com/178260 return chrome::GetTotalBrowserCountForProfile(profile) == 0 && - CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kShowAppList); } void ChromeProcessManagerDelegate::Observe( diff --git a/chrome/browser/extensions/chrome_ui_overrides_browsertest.cc b/chrome/browser/extensions/chrome_ui_overrides_browsertest.cc index 66fde53..0065195 100644 --- a/chrome/browser/extensions/chrome_ui_overrides_browsertest.cc +++ b/chrome/browser/extensions/chrome_ui_overrides_browsertest.cc @@ -13,9 +13,8 @@ class ChromeUIOverridesBrowserTest : public ExtensionBrowserTest {}; IN_PROC_BROWSER_TEST_F(ChromeUIOverridesBrowserTest, BookmarkShortcutOverrides) { // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("bookmarks_ui"))); EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_BOOKMARK_PAGE)); diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index 907d8a7..dab19d0 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -268,7 +268,8 @@ bool ComponentLoader::Exists(const std::string& id) const { void ComponentLoader::AddFileManagerExtension() { #if defined(OS_CHROMEOS) #ifndef NDEBUG - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) { base::FilePath filemgr_extension_path( command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); @@ -355,7 +356,8 @@ void ComponentLoader::AddChromeVoxExtension( base::FilePath chromevox_path = resources_path.Append(extension_misc::kChromeVoxExtensionPath); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); const char* manifest_filename = is_guest ? extension_misc::kChromeVoxGuestManifestFilename @@ -383,7 +385,8 @@ void ComponentLoader::AddChromeVoxExtensionWithManifest( } std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; std::string id = Add(idr, @@ -459,7 +462,8 @@ void ComponentLoader::AddDefaultComponentExtensions( // Skip all other extensions that require user session presence. if (!skip_session_components) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) Add(IDR_BOOKMARKS_MANIFEST, base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); @@ -501,7 +505,8 @@ void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( bool skip_session_components) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); // Component extensions with background pages are not enabled during tests // because they generate a lot of background behavior that can interfere. @@ -637,7 +642,8 @@ void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { void ComponentLoader::EnableFileSystemInGuestMode(const std::string& id) { #if defined(OS_CHROMEOS) - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(chromeos::switches::kGuestSession)) { // TODO(dpolukhin): Hack to enable HTML5 temporary file system for // the extension. Some component extensions don't work without temporary diff --git a/chrome/browser/extensions/convert_web_app_browsertest.cc b/chrome/browser/extensions/convert_web_app_browsertest.cc index 0d38ce4..5210ca0 100644 --- a/chrome/browser/extensions/convert_web_app_browsertest.cc +++ b/chrome/browser/extensions/convert_web_app_browsertest.cc @@ -60,7 +60,8 @@ class ExtensionFromWebAppTest IN_PROC_BROWSER_TEST_F(ExtensionFromWebAppTest, DISABLED_Basic) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc index 759e2ca..7fc0707 100644 --- a/chrome/browser/extensions/crx_installer_browsertest.cc +++ b/chrome/browser/extensions/crx_installer_browsertest.cc @@ -166,17 +166,18 @@ class ManagementPolicyMock : public extensions::ManagementPolicy::Provider { // lifetime of this class. class ScopedExperimentalCommandLine { public: - ScopedExperimentalCommandLine() : saved_(*CommandLine::ForCurrentProcess()) { - CommandLine::ForCurrentProcess()->AppendSwitch( + ScopedExperimentalCommandLine() + : saved_(*base::CommandLine::ForCurrentProcess()) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExperimentalExtensionApis); } ~ScopedExperimentalCommandLine() { - *CommandLine::ForCurrentProcess() = saved_; + *base::CommandLine::ForCurrentProcess() = saved_; } private: - CommandLine saved_; + base::CommandLine saved_; }; } // namespace @@ -555,7 +556,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, KioskOnlyTest) { #if defined(OS_CHROMEOS) IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, InstallToSharedLocation) { base::ShadowingAtExitManager at_exit_manager; - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( chromeos::switches::kEnableExtensionAssetsSharing); base::ScopedTempDir cache_dir; ASSERT_TRUE(cache_dir.CreateUniqueTempDir()); diff --git a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc index b0348e3..1d56b5f 100644 --- a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc +++ b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc @@ -133,7 +133,7 @@ class ExtensionActionIconFactoryTest file_thread_.Start(); io_thread_.Start(); profile_.reset(new TestingProfile); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); extension_service_ = static_cast<extensions::TestExtensionSystem*>( extensions::ExtensionSystem::Get(profile_.get()))-> CreateExtensionService(&command_line, base::FilePath(), false); diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index fcc0035..a2b923e 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -313,7 +313,7 @@ bool ExtensionApiTest::RunExtensionTestImpl(const std::string& extension_name, AppLaunchParams params(browser()->profile(), extension, extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, extensions::SOURCE_TEST); - params.command_line = *CommandLine::ForCurrentProcess(); + params.command_line = *base::CommandLine::ForCurrentProcess(); OpenApplication(params); } @@ -413,7 +413,7 @@ bool ExtensionApiTest::StartSpawnedTestServer() { return true; } -void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { +void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { ExtensionBrowserTest::SetUpCommandLine(command_line); test_data_dir_ = test_data_dir_.AppendASCII("api_test"); } diff --git a/chrome/browser/extensions/extension_assets_manager_chromeos.cc b/chrome/browser/extensions/extension_assets_manager_chromeos.cc index 46a9a11..f4efa6e 100644 --- a/chrome/browser/extensions/extension_assets_manager_chromeos.cc +++ b/chrome/browser/extensions/extension_assets_manager_chromeos.cc @@ -253,7 +253,7 @@ base::SequencedTaskRunner* ExtensionAssetsManagerChromeOS::GetFileTaskRunner( bool ExtensionAssetsManagerChromeOS::CanShareAssets( const Extension* extension, const base::FilePath& unpacked_extension_root) { - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kEnableExtensionAssetsSharing)) { return false; } diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 4a91993..bf1fab9 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -116,7 +116,7 @@ void ExtensionBrowserTest::SetUp() { InProcessBrowserTest::SetUp(); } -void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { +void ExtensionBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); test_data_dir_ = test_data_dir_.AppendASCII("extensions"); observer_.reset(new ExtensionTestNotificationObserver(browser())); diff --git a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc index 94a4934..c3cd109 100644 --- a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc +++ b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc @@ -33,7 +33,7 @@ using extensions::ExtensionPrefs; class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, "http://localhost/autoupdate/updates.xml"); diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc index 46f963c..9d3c724 100644 --- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc +++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc @@ -235,7 +235,7 @@ class ExtensionGCMAppHandlerTest : public testing::Test { base::FilePath extensions_install_dir = temp_dir_.path().Append(FILE_PATH_LITERAL("Extensions")); extension_system->CreateExtensionService( - CommandLine::ForCurrentProcess(), extensions_install_dir, false); + base::CommandLine::ForCurrentProcess(), extensions_install_dir, false); extension_service_ = extension_system->Get(profile())->extension_service(); extension_service_->set_extensions_enabled(true); extension_service_->set_show_extensions_prompts(false); diff --git a/chrome/browser/extensions/extension_icon_source_apitest.cc b/chrome/browser/extensions/extension_icon_source_apitest.cc index 8f18dfe..9b64263 100644 --- a/chrome/browser/extensions/extension_icon_source_apitest.cc +++ b/chrome/browser/extensions/extension_icon_source_apitest.cc @@ -17,7 +17,7 @@ class ExtensionIconSourceTest : public ExtensionApiTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch( extensions::switches::kAllowLegacyExtensionManifests); diff --git a/chrome/browser/extensions/extension_install_ui_browsertest.cc b/chrome/browser/extensions/extension_install_ui_browsertest.cc index 5f414e5..f99e521 100644 --- a/chrome/browser/extensions/extension_install_ui_browsertest.cc +++ b/chrome/browser/extensions/extension_install_ui_browsertest.cc @@ -82,7 +82,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, MAYBE_TestThemeInstallUndoResetsToDefault) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -112,7 +113,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, TestThemeInstallUndoResetsToPreviousTheme) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/extension_keybinding_apitest.cc b/chrome/browser/extensions/extension_keybinding_apitest.cc index 29c93a7d..b637223 100644 --- a/chrome/browser/extensions/extension_keybinding_apitest.cc +++ b/chrome/browser/extensions/extension_keybinding_apitest.cc @@ -276,9 +276,8 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, OverwriteBookmarkShortcut) { ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); ASSERT_TRUE(RunExtensionTest("keybinding/overwrite_bookmark_shortcut")) << message_; @@ -321,9 +320,8 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); ASSERT_TRUE(RunExtensionTest("keybinding/overwrite_bookmark_shortcut")) << message_; @@ -365,9 +363,8 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index 8a963b3..0cb5d54 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc @@ -391,11 +391,9 @@ class ExtensionMessageBubbleTest : public testing::Test { // service to work inside a unit test and access the extension prefs. thread_bundle_.reset(new content::TestBrowserThreadBundle); profile_.reset(new TestingProfile); - static_cast<TestExtensionSystem*>( - ExtensionSystem::Get(profile()))->CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile())) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); service_ = ExtensionSystem::Get(profile())->extension_service(); service_->Init(); } @@ -406,7 +404,7 @@ class ExtensionMessageBubbleTest : public testing::Test { } void SetUp() override { - command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); + command_line_.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); } protected: @@ -427,7 +425,7 @@ class ExtensionMessageBubbleTest : public testing::Test { ExtensionService* service_; private: - scoped_ptr<CommandLine> command_line_; + scoped_ptr<base::CommandLine> command_line_; scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc index 64894ac..6767f2a 100644 --- a/chrome/browser/extensions/extension_messages_apitest.cc +++ b/chrome/browser/extensions/extension_messages_apitest.cc @@ -129,7 +129,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MessagingEventURL) { // Tests connecting from a panel to its extension. class PanelMessagingTest : public ExtensionApiTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnablePanels); } diff --git a/chrome/browser/extensions/extension_resource_request_policy_apitest.cc b/chrome/browser/extensions/extension_resource_request_policy_apitest.cc index 74cf0af..7553bda 100644 --- a/chrome/browser/extensions/extension_resource_request_policy_apitest.cc +++ b/chrome/browser/extensions/extension_resource_request_policy_apitest.cc @@ -17,7 +17,7 @@ class ExtensionResourceRequestPolicyTest : public ExtensionApiTest { protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch( extensions::switches::kAllowLegacyExtensionManifests); @@ -30,7 +30,8 @@ class ExtensionResourceRequestPolicyTest : public ExtensionApiTest { IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 7dd707b..a935947 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -246,7 +246,7 @@ bool ExtensionService::UninstallExtensionHelper( } ExtensionService::ExtensionService(Profile* profile, - const CommandLine* command_line, + const base::CommandLine* command_line, const base::FilePath& install_directory, extensions::ExtensionPrefs* extension_prefs, extensions::Blacklist* blacklist, @@ -388,7 +388,7 @@ void ExtensionService::Init() { DCHECK(!is_ready()); // Can't redo init. DCHECK_EQ(registry_->enabled_extensions().size(), 0u); - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kInstallEphemeralAppFromWebstore)) { // The sole purpose of this launch is to install a new extension from CWS // and immediately terminate: loading already installed extensions is diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 17cb2d8b..947c600 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -5601,12 +5601,12 @@ TEST(ExtensionServiceTestSimple, Enabledness) { scoped_ptr<chromeos::ScopedTestUserManager> user_manager( new chromeos::ScopedTestUserManager); #endif - scoped_ptr<CommandLine> command_line; + scoped_ptr<base::CommandLine> command_line; base::FilePath install_dir = profile->GetPath() .AppendASCII(extensions::kInstallDirectoryName); // By default, we are enabled. - command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); + command_line.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); ExtensionService* service = static_cast<extensions::TestExtensionSystem*>( ExtensionSystem::Get(profile.get()))-> CreateExtensionService( @@ -5653,7 +5653,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { recorder.set_ready(false); profile.reset(new TestingProfile()); profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); - command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); + command_line.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); service = static_cast<extensions::TestExtensionSystem*>( ExtensionSystem::Get(profile.get()))-> CreateExtensionService( @@ -7041,7 +7041,7 @@ TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) { // permissions. TEST_F(ExtensionServiceTest, InstallWhitelistedExtension) { std::string test_id = "hdkklepkcpckhnpgjnmbdfhehckloojk"; - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, test_id); InitializeEmptyExtensionService(); diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc index c1eddb6..f07999f 100644 --- a/chrome/browser/extensions/extension_special_storage_policy.cc +++ b/chrome/browser/extensions/extension_special_storage_policy.cc @@ -89,7 +89,8 @@ bool ExtensionSpecialStoragePolicy::IsStorageProtected(const GURL& origin) { } bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUnlimitedStorage)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kUnlimitedStorage)) return true; if (origin.SchemeIs(content::kChromeDevToolsScheme) && diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index 25e761d..f8040d9 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -50,7 +50,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { protected: // InProcessBrowserTest - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { if (load_extensions_.empty()) { // If no |load_extensions_| were specified, allow unauthenticated // extension settings to be loaded from Preferences as if they had been diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc index 3886676..d1d5e12 100644 --- a/chrome/browser/extensions/extension_system_impl.cc +++ b/chrome/browser/extensions/extension_system_impl.cc @@ -294,7 +294,8 @@ class ContentVerifierDelegateImpl : public ContentVerifierDelegate { } // namespace void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); navigation_observer_.reset(new NavigationObserver(profile_)); @@ -314,14 +315,10 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { autoupdate_enabled = false; #endif extension_service_.reset(new ExtensionService( - profile_, - CommandLine::ForCurrentProcess(), + profile_, base::CommandLine::ForCurrentProcess(), profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName), - ExtensionPrefs::Get(profile_), - Blacklist::Get(profile_), - autoupdate_enabled, - extensions_enabled, - &ready_)); + ExtensionPrefs::Get(profile_), Blacklist::Get(profile_), + autoupdate_enabled, extensions_enabled, &ready_)); // These services must be registered before the ExtensionService tries to // load any extensions. @@ -360,11 +357,11 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { skip_session_extensions); #endif if (command_line->HasSwitch(switches::kLoadComponentExtension)) { - CommandLine::StringType path_list = command_line->GetSwitchValueNative( - switches::kLoadComponentExtension); - base::StringTokenizerT<CommandLine::StringType, - CommandLine::StringType::const_iterator> t(path_list, - FILE_PATH_LITERAL(",")); + base::CommandLine::StringType path_list = + command_line->GetSwitchValueNative(switches::kLoadComponentExtension); + base::StringTokenizerT<base::CommandLine::StringType, + base::CommandLine::StringType::const_iterator> + t(path_list, FILE_PATH_LITERAL(",")); while (t.GetNext()) { // Load the component extension manifest synchronously. // Blocking the UI thread is acceptable here since @@ -387,11 +384,11 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { // TODO(yoz): Seems like this should move into ExtensionService::Init. // But maybe it's no longer important. if (command_line->HasSwitch(switches::kLoadExtension)) { - CommandLine::StringType path_list = command_line->GetSwitchValueNative( - switches::kLoadExtension); - base::StringTokenizerT<CommandLine::StringType, - CommandLine::StringType::const_iterator> t(path_list, - FILE_PATH_LITERAL(",")); + base::CommandLine::StringType path_list = + command_line->GetSwitchValueNative(switches::kLoadExtension); + base::StringTokenizerT<base::CommandLine::StringType, + base::CommandLine::StringType::const_iterator> + t(path_list, FILE_PATH_LITERAL(",")); while (t.GetNext()) { std::string extension_id; UnpackedInstaller::Create(extension_service_.get())-> diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc index 64ba4b4..4709c98 100644 --- a/chrome/browser/extensions/extension_tabs_apitest.cc +++ b/chrome/browser/extensions/extension_tabs_apitest.cc @@ -38,7 +38,7 @@ class ExtensionApiNewTabTest : public ExtensionApiTest { public: ExtensionApiNewTabTest() {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // Override the default which InProcessBrowserTest adds if it doesn't see a // homepage. @@ -165,7 +165,7 @@ class ExtensionApiCaptureTest : public ExtensionApiTest { ExtensionApiTest::SetUp(); } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); } }; diff --git a/chrome/browser/extensions/extension_ui_unittest.cc b/chrome/browser/extensions/extension_ui_unittest.cc index f4c7899..656e185 100644 --- a/chrome/browser/extensions/extension_ui_unittest.cc +++ b/chrome/browser/extensions/extension_ui_unittest.cc @@ -51,7 +51,7 @@ class ExtensionUITest : public testing::Test { TestExtensionSystem* system = static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); extension_service_ = system->CreateExtensionService( - CommandLine::ForCurrentProcess(), base::FilePath(), false); + base::CommandLine::ForCurrentProcess(), base::FilePath(), false); management_policy_ = system->management_policy(); handler_.reset(new ExtensionSettingsHandler(extension_service_, diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc index 11fb243..1724be0 100644 --- a/chrome/browser/extensions/extension_util.cc +++ b/chrome/browser/extensions/extension_util.cc @@ -155,7 +155,7 @@ bool CanLoadInIncognito(const Extension* extension, bool AllowFileAccess(const std::string& extension_id, content::BrowserContext* context) { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableExtensionsFileAccessCheck) || ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); } @@ -350,8 +350,8 @@ const gfx::ImageSkia& GetDefaultExtensionIcon() { } bool IsStreamlinedHostedAppsEnabled() { - return !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableNewBookmarkApps); + return !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableNewBookmarkApps); } } // namespace util diff --git a/chrome/browser/extensions/extension_web_ui_unittest.cc b/chrome/browser/extensions/extension_web_ui_unittest.cc index 2833981..eada95f 100644 --- a/chrome/browser/extensions/extension_web_ui_unittest.cc +++ b/chrome/browser/extensions/extension_web_ui_unittest.cc @@ -34,7 +34,7 @@ class ExtensionWebUITest : public testing::Test { TestExtensionSystem* system = static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); extension_service_ = system->CreateExtensionService( - CommandLine::ForCurrentProcess(), base::FilePath(), false); + base::CommandLine::ForCurrentProcess(), base::FilePath(), false); } void TearDown() override { diff --git a/chrome/browser/extensions/external_component_loader.cc b/chrome/browser/extensions/external_component_loader.cc index ba87858..c9f449c 100644 --- a/chrome/browser/extensions/external_component_loader.cc +++ b/chrome/browser/extensions/external_component_loader.cc @@ -75,7 +75,8 @@ void ExternalComponentLoader::StartLoading() { #if defined(OS_CHROMEOS) { - CommandLine* const command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* const command_line = + base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) { const std::string extension_id = extension_misc::kZIPUnpackerExtensionId; prefs_->SetString(extension_id + ".external_update_url", diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index 2f3d829..100dacd 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc @@ -448,8 +448,8 @@ void ExternalProviderImpl::CreateExternalProviders( // In tests don't install extensions from default external sources. // It would only slowdown tests and make them flaky. - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableDefaultApps)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableDefaultApps)) return; // On Mac OS, items in /Library/... should be written by the superuser. diff --git a/chrome/browser/extensions/external_provider_impl_chromeos_unittest.cc b/chrome/browser/extensions/external_provider_impl_chromeos_unittest.cc index c9403de..9f72ff2 100644 --- a/chrome/browser/extensions/external_provider_impl_chromeos_unittest.cc +++ b/chrome/browser/extensions/external_provider_impl_chromeos_unittest.cc @@ -97,7 +97,7 @@ TEST_F(ExternalProviderImplChromeOSTest, Normal) { // App mode, no external app should be installed. TEST_F(ExternalProviderImplChromeOSTest, AppMode) { - CommandLine* command = CommandLine::ForCurrentProcess(); + base::CommandLine* command = base::CommandLine::ForCurrentProcess(); command->AppendSwitchASCII(switches::kForceAppMode, std::string()); command->AppendSwitchASCII(switches::kAppId, std::string("app_id")); diff --git a/chrome/browser/extensions/external_provider_impl_unittest.cc b/chrome/browser/extensions/external_provider_impl_unittest.cc index 4c1b46b..011d032 100644 --- a/chrome/browser/extensions/external_provider_impl_unittest.cc +++ b/chrome/browser/extensions/external_provider_impl_unittest.cc @@ -112,7 +112,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase { test_extension_cache_.reset(new ExtensionCacheFake()); - CommandLine* cmdline = CommandLine::ForCurrentProcess(); + base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); cmdline->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, test_server_->GetURL(kManifestPath).spec()); } diff --git a/chrome/browser/extensions/install_signer.cc b/chrome/browser/extensions/install_signer.cc index 8d4c35e..7ddaa62 100644 --- a/chrome/browser/extensions/install_signer.cc +++ b/chrome/browser/extensions/install_signer.cc @@ -287,8 +287,9 @@ class InstallSigner::FetcherDelegate : public net::URLFetcherDelegate { // static ExtensionIdSet InstallSigner::GetForcedNotFromWebstore() { - std::string value = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kExtensionsNotWebstore); + std::string value = + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kExtensionsNotWebstore); if (value.empty()) return ExtensionIdSet(); diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc index 66f20b6..2f23209 100644 --- a/chrome/browser/extensions/install_verifier.cc +++ b/chrome/browser/extensions/install_verifier.cc @@ -55,8 +55,9 @@ VerifyStatus GetExperimentStatus() { const std::string group = base::FieldTrialList::FindFullName( kExperimentName); - std::string forced_trials = CommandLine::ForCurrentProcess()-> - GetSwitchValueASCII(switches::kForceFieldTrials); + std::string forced_trials = + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kForceFieldTrials); if (forced_trials.find(kExperimentName) != std::string::npos) { // We don't want to allow turning off enforcement by forcing the field // trial group to something other than enforcement. @@ -81,7 +82,7 @@ VerifyStatus GetExperimentStatus() { } VerifyStatus GetCommandLineStatus() { - const CommandLine* cmdline = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); if (!InstallSigner::GetForcedNotFromWebstore().empty()) return ENFORCE; diff --git a/chrome/browser/extensions/location_bar_controller_unittest.cc b/chrome/browser/extensions/location_bar_controller_unittest.cc index 8c492d1..dfc4c43 100644 --- a/chrome/browser/extensions/location_bar_controller_unittest.cc +++ b/chrome/browser/extensions/location_bar_controller_unittest.cc @@ -46,7 +46,7 @@ class LocationBarControllerUnitTest : public ChromeRenderViewHostTestHarness { TabHelper::CreateForWebContents(web_contents()); // Create an ExtensionService so the LocationBarController can find its // extensions. - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); Profile* profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext()); extension_service_ = static_cast<TestExtensionSystem*>( diff --git a/chrome/browser/extensions/pack_extension_unittest.cc b/chrome/browser/extensions/pack_extension_unittest.cc index e12762b..daf05ba 100644 --- a/chrome/browser/extensions/pack_extension_unittest.cc +++ b/chrome/browser/extensions/pack_extension_unittest.cc @@ -32,7 +32,7 @@ class PackExtensionTest : public testing::Test { base::ScopedTempDir temp_dir; EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); EXPECT_TRUE(base::CopyDirectory(path, temp_dir.path(), true)); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitchPath(switches::kPackExtension, temp_dir.path().Append(path.BaseName())); return startup_helper_.PackExtension(command_line); diff --git a/chrome/browser/extensions/page_action_browsertest.cc b/chrome/browser/extensions/page_action_browsertest.cc index 3a36a4f..c0cebef 100644 --- a/chrome/browser/extensions/page_action_browsertest.cc +++ b/chrome/browser/extensions/page_action_browsertest.cc @@ -33,7 +33,7 @@ const std::string kHashPageB = IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionCrash25562) { ASSERT_TRUE(test_server()->Start()); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAllowLegacyExtensionManifests); // This page action will not show an icon, since it doesn't specify one but diff --git a/chrome/browser/extensions/plugin_apitest.cc b/chrome/browser/extensions/plugin_apitest.cc index f129958..02f03f3 100644 --- a/chrome/browser/extensions/plugin_apitest.cc +++ b/chrome/browser/extensions/plugin_apitest.cc @@ -131,7 +131,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/browser/extensions/process_management_browsertest.cc b/chrome/browser/extensions/process_management_browsertest.cc index 97c5b25..fc1532e 100644 --- a/chrome/browser/extensions/process_management_browsertest.cc +++ b/chrome/browser/extensions/process_management_browsertest.cc @@ -29,7 +29,7 @@ namespace { class ProcessManagementTest : public ExtensionBrowserTest { private: // This is needed for testing isolated apps, which are still experimental. - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); diff --git a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc index 4766862..c636b89 100644 --- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc +++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc @@ -40,7 +40,8 @@ void LoadGaiaAuthExtension(BrowserContext* context) { DCHECK_CURRENTLY_ON(BrowserThread::UI); extensions::ComponentLoader* component_loader = GetComponentLoader(context); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAuthExtensionPath)) { base::FilePath auth_extension_path = command_line->GetSwitchValuePath(switches::kAuthExtensionPath); diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc index b90fed3..4432e7f 100644 --- a/chrome/browser/extensions/startup_helper.cc +++ b/chrome/browser/extensions/startup_helper.cc @@ -94,7 +94,7 @@ void StartupHelper::OnPackFailure(const std::string& error_message, PrintPackExtensionMessage(error_message); } -bool StartupHelper::PackExtension(const CommandLine& cmd_line) { +bool StartupHelper::PackExtension(const base::CommandLine& cmd_line) { if (!cmd_line.HasSwitch(switches::kPackExtension)) return false; @@ -205,7 +205,7 @@ class ValidateCrxHelper : public SandboxedUnpackerClient { } // namespace -bool StartupHelper::ValidateCrx(const CommandLine& cmd_line, +bool StartupHelper::ValidateCrx(const base::CommandLine& cmd_line, std::string* error) { CHECK(error); base::FilePath path = cmd_line.GetSwitchValuePath(switches::kValidateCrx); @@ -304,7 +304,7 @@ void AppInstallHelper::OnAppInstallComplete(bool success, } // namespace -bool StartupHelper::InstallEphemeralApp(const CommandLine& cmd_line, +bool StartupHelper::InstallEphemeralApp(const base::CommandLine& cmd_line, Profile* profile) { std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallEphemeralAppFromWebstore); diff --git a/chrome/browser/extensions/startup_helper_browsertest.cc b/chrome/browser/extensions/startup_helper_browsertest.cc index 81bf15e..f69701b 100644 --- a/chrome/browser/extensions/startup_helper_browsertest.cc +++ b/chrome/browser/extensions/startup_helper_browsertest.cc @@ -17,7 +17,7 @@ class StartupHelperBrowserTest : public InProcessBrowserTest { StartupHelperBrowserTest() {} ~StartupHelperBrowserTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kNoStartupWindow); PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); test_data_dir_ = test_data_dir_.AppendASCII("extensions"); @@ -43,7 +43,7 @@ IN_PROC_BROWSER_TEST_F(StartupHelperBrowserTest, ValidateCrx) { for (std::vector<std::pair<base::FilePath, bool> >::iterator i = expectations.begin(); i != expectations.end(); ++i) { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); const base::FilePath& path = i->first; command_line.AppendSwitchPath(switches::kValidateCrx, path); diff --git a/chrome/browser/extensions/test_extension_environment.cc b/chrome/browser/extensions/test_extension_environment.cc index e8d9850..8b5c30e 100644 --- a/chrome/browser/extensions/test_extension_environment.cc +++ b/chrome/browser/extensions/test_extension_environment.cc @@ -53,7 +53,7 @@ TestExtensionSystem* TestExtensionEnvironment::GetExtensionSystem() { ExtensionService* TestExtensionEnvironment::GetExtensionService() { if (extension_service_ == NULL) { extension_service_ = GetExtensionSystem()->CreateExtensionService( - CommandLine::ForCurrentProcess(), base::FilePath(), false); + base::CommandLine::ForCurrentProcess(), base::FilePath(), false); } return extension_service_; } @@ -61,7 +61,7 @@ ExtensionService* TestExtensionEnvironment::GetExtensionService() { ExtensionPrefs* TestExtensionEnvironment::GetExtensionPrefs() { if (extension_prefs_ == NULL) { extension_prefs_ = GetExtensionSystem()->CreateExtensionPrefs( - CommandLine::ForCurrentProcess(), base::FilePath()); + base::CommandLine::ForCurrentProcess(), base::FilePath()); } return extension_prefs_; } diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc index 7a383fd..2897549 100644 --- a/chrome/browser/extensions/test_extension_system.cc +++ b/chrome/browser/extensions/test_extension_system.cc @@ -51,7 +51,7 @@ void TestExtensionSystem::Shutdown() { } ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( - const CommandLine* command_line, + const base::CommandLine* command_line, const base::FilePath& install_directory) { bool extensions_disabled = command_line && command_line->HasSwitch(switches::kDisableExtensions); @@ -75,7 +75,7 @@ ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( } ExtensionService* TestExtensionSystem::CreateExtensionService( - const CommandLine* command_line, + const base::CommandLine* command_line, const base::FilePath& install_directory, bool autoupdate_enabled) { if (!ExtensionPrefs::Get(profile_)) diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 52b8f44..ff6d808 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -1489,12 +1489,9 @@ class ExtensionUpdaterTest : public testing::Test { // service, not on our mock |service|. This allows us to fake // the CrxInstaller actions we want. TestingProfile profile; - static_cast<TestExtensionSystem*>( - ExtensionSystem::Get(&profile))-> - CreateExtensionService( - CommandLine::ForCurrentProcess(), - base::FilePath(), - false); + static_cast<TestExtensionSystem*>(ExtensionSystem::Get(&profile)) + ->CreateExtensionService(base::CommandLine::ForCurrentProcess(), + base::FilePath(), false); ExtensionService* extension_service = ExtensionSystem::Get(&profile)->extension_service(); extension_service->set_extensions_enabled(true); diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 3c4c867..1ec913ef 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -184,7 +184,7 @@ GURL WebstoreInstaller::GetWebstoreInstallURL( install_source = kDefaultInstallSource; } - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kAppsGalleryDownloadURL)) { std::string download_url = cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); diff --git a/chrome/browser/extensions/webstore_installer_test.cc b/chrome/browser/extensions/webstore_installer_test.cc index c97d78c..ce52e40 100644 --- a/chrome/browser/extensions/webstore_installer_test.cc +++ b/chrome/browser/extensions/webstore_installer_test.cc @@ -50,7 +50,7 @@ WebstoreInstallerTest::WebstoreInstallerTest( WebstoreInstallerTest::~WebstoreInstallerTest() {} -void WebstoreInstallerTest::SetUpCommandLine(CommandLine* command_line) { +void WebstoreInstallerTest::SetUpCommandLine(base::CommandLine* command_line) { ExtensionBrowserTest::SetUpCommandLine(command_line); // We start the test server now instead of in // SetUpInProcessBrowserTestFixture so that we can get its port number. @@ -64,7 +64,7 @@ void WebstoreInstallerTest::SetUpCommandLine(CommandLine* command_line) { switches::kAppsGalleryURL, test_gallery_url_); GURL crx_url = GenerateTestServerUrl(webstore_domain_, crx_filename_); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryUpdateURL, crx_url.spec()); // Allow tests to call window.gc(), so that we can check that callback diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc index aa34d26..fd61a90 100644 --- a/chrome/browser/extensions/window_open_apitest.cc +++ b/chrome/browser/extensions/window_open_apitest.cc @@ -48,7 +48,7 @@ using content::WebContents; // Disabled, http://crbug.com/64899. IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); extensions::ResultCatcher catcher; @@ -232,7 +232,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowArgumentsOverflow) { } class WindowOpenPanelDisabledTest : public ExtensionApiTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); // TODO(jennb): Re-enable when panels are enabled by default. // command_line->AppendSwitch(switches::kDisablePanels); @@ -245,7 +245,7 @@ IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, } class WindowOpenPanelTest : public ExtensionApiTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnablePanels); } @@ -287,14 +287,16 @@ IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_CloseNonExtensionPanelsOnUninstall) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif #if defined(USE_ASH_PANELS) // On Ash, new panel windows open as popup windows instead. int num_popups, num_panels; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePanels)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePanels)) { num_popups = 2; num_panels = 2; } else { @@ -340,7 +342,8 @@ IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, // Expect everything else, including panels, to close. num_popups -= 1; #if defined(USE_ASH_PANELS) - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePanels)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePanels)) { // On Ash, new panel windows open as popup windows instead, so there are 2 // extension domain popups that will close (instead of 1 popup on non-Ash). num_popups -= 1; diff --git a/chrome/browser/extensions/window_open_interactive_apitest.cc b/chrome/browser/extensions/window_open_interactive_apitest.cc index 00af11f..67d7205 100644 --- a/chrome/browser/extensions/window_open_interactive_apitest.cc +++ b/chrome/browser/extensions/window_open_interactive_apitest.cc @@ -7,7 +7,7 @@ #include "chrome/common/chrome_switches.h" class WindowOpenPanelTest : public ExtensionApiTest { - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kEnablePanels); } diff --git a/chrome/browser/external_extension_browsertest.cc b/chrome/browser/external_extension_browsertest.cc index dcde9d3..9728727 100644 --- a/chrome/browser/external_extension_browsertest.cc +++ b/chrome/browser/external_extension_browsertest.cc @@ -34,7 +34,7 @@ class SearchProviderTest : public InProcessBrowserTest { protected: SearchProviderTest() {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ASSERT_TRUE(test_server()->Start()); // Map all hosts to our local server. |