diff options
194 files changed, 647 insertions, 483 deletions
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 90f4def..b1edcfd 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc @@ -237,7 +237,7 @@ std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( } void AwContentBrowserClient::AppendExtraCommandLineSwitches( - CommandLine* command_line, + base::CommandLine* command_line, int child_process_id) { NOTREACHED() << "Android WebView does not support multi-process yet"; } diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index eb601cd..28dc4d0 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h @@ -55,7 +55,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient { content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual std::string GetCanonicalEncodingNameByAliasName( const std::string& alias_name) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual std::string GetApplicationLocale() OVERRIDE; virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; diff --git a/apps/app_load_service.h b/apps/app_load_service.h index ec71a7e..2ccd3e0 100644 --- a/apps/app_load_service.h +++ b/apps/app_load_service.h @@ -37,7 +37,7 @@ class AppLoadService : public KeyedService, PostReloadAction(); PostReloadActionType action_type; - CommandLine command_line; + base::CommandLine command_line; base::FilePath current_dir; }; @@ -53,7 +53,7 @@ class AppLoadService : public KeyedService, // launch parameters. Returns true if loading the extension has begun // successfully. bool LoadAndLaunch(const base::FilePath& extension_path, - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& current_dir); static AppLoadService* Get(Profile* profile); diff --git a/apps/launcher.h b/apps/launcher.h index 579da0f..d41f517 100644 --- a/apps/launcher.h +++ b/apps/launcher.h @@ -7,11 +7,11 @@ #include <string> -class CommandLine; class GURL; class Profile; namespace base { +class CommandLine; class FilePath; } @@ -27,7 +27,7 @@ namespace apps { // |current_directory| is used to expand any relative paths on the command line. void LaunchPlatformAppWithCommandLine(Profile* profile, const extensions::Extension* extension, - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& current_directory); // Launches the platform app |extension| by issuing an onLaunched event diff --git a/apps/shell/browser/shell_content_browser_client.h b/apps/shell/browser/shell_content_browser_client.h index 7de6844..de9331d 100644 --- a/apps/shell/browser/shell_content_browser_client.h +++ b/apps/shell/browser/shell_content_browser_client.h @@ -41,7 +41,7 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { OVERRIDE; virtual void SiteInstanceDeleting(content::SiteInstance* site_instance) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) OVERRIDE; diff --git a/apps/shell/browser/shell_extensions_browser_client.h b/apps/shell/browser/shell_extensions_browser_client.h index 4524ec3..d491adf 100644 --- a/apps/shell/browser/shell_extensions_browser_client.h +++ b/apps/shell/browser/shell_extensions_browser_client.h @@ -24,7 +24,7 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { // ExtensionsBrowserClient overrides: virtual bool IsShuttingDown() OVERRIDE; - virtual bool AreExtensionsDisabled(const CommandLine& command_line, + virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, content::BrowserContext* context) OVERRIDE; virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; virtual bool IsSameContext(content::BrowserContext* first, diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h index 38c08c3..d7c1d06 100644 --- a/ash/desktop_background/desktop_background_controller.h +++ b/ash/desktop_background/desktop_background_controller.h @@ -19,12 +19,14 @@ typedef unsigned int SkColor; -class CommandLine; - namespace aura { class Window; } +namespace base { +class CommandLine; +} + namespace ash { enum WallpaperLayout { @@ -81,7 +83,7 @@ class ASH_EXPORT DesktopBackgroundController return desktop_background_mode_; } - void set_command_line_for_testing(CommandLine* command_line) { + void set_command_line_for_testing(base::CommandLine* command_line) { command_line_for_testing_ = command_line; } @@ -189,7 +191,7 @@ class ASH_EXPORT DesktopBackgroundController static gfx::Size GetMaxDisplaySizeInNative(); // If non-NULL, used in place of the real command line. - CommandLine* command_line_for_testing_; + base::CommandLine* command_line_for_testing_; // Can change at runtime. bool locked_; diff --git a/ash/shell.h b/ash/shell.h index f19645f..ddb59b6 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -28,8 +28,6 @@ #include "ui/gfx/size.h" #include "ui/wm/core/cursor_manager.h" -class CommandLine; - namespace app_list { class AppListView; } diff --git a/base/command_line.cc b/base/command_line.cc index be6b4f2..6e37d6b 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -20,11 +20,12 @@ #include <shellapi.h> #endif -using base::FilePath; +namespace base { CommandLine* CommandLine::current_process_commandline_ = NULL; namespace { + const CommandLine::CharType kSwitchTerminator[] = FILE_PATH_LITERAL("--"); const CommandLine::CharType kSwitchValueSeparator[] = FILE_PATH_LITERAL("="); @@ -74,14 +75,14 @@ void AppendSwitchesAndArguments(CommandLine& command_line, bool parse_switches = true; for (size_t i = 1; i < argv.size(); ++i) { CommandLine::StringType arg = argv[i]; - base::TrimWhitespace(arg, base::TRIM_ALL, &arg); + TrimWhitespace(arg, TRIM_ALL, &arg); CommandLine::StringType switch_string; CommandLine::StringType switch_value; parse_switches &= (arg != kSwitchTerminator); if (parse_switches && IsSwitch(arg, &switch_string, &switch_value)) { #if defined(OS_WIN) - command_line.AppendSwitchNative(base::UTF16ToASCII(switch_string), + command_line.AppendSwitchNative(UTF16ToASCII(switch_string), switch_value); #elif defined(OS_POSIX) command_line.AppendSwitchNative(switch_string, switch_value); @@ -294,7 +295,7 @@ FilePath CommandLine::GetProgram() const { } void CommandLine::SetProgram(const FilePath& program) { - base::TrimWhitespace(program.value(), base::TRIM_ALL, &argv_[0]); + TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]); } bool CommandLine::HasSwitch(const std::string& switch_string) const { @@ -309,7 +310,7 @@ std::string CommandLine::GetSwitchValueASCII( return std::string(); } #if defined(OS_WIN) - return base::UTF16ToASCII(value); + return UTF16ToASCII(value); #else return value; #endif @@ -340,7 +341,7 @@ void CommandLine::AppendSwitchNative(const std::string& switch_string, const CommandLine::StringType& value) { std::string switch_key(LowerASCIIOnWindows(switch_string)); #if defined(OS_WIN) - StringType combined_switch_string(base::ASCIIToWide(switch_key)); + StringType combined_switch_string(ASCIIToWide(switch_key)); #elif defined(OS_POSIX) StringType combined_switch_string(switch_string); #endif @@ -358,7 +359,7 @@ void CommandLine::AppendSwitchNative(const std::string& switch_string, void CommandLine::AppendSwitchASCII(const std::string& switch_string, const std::string& value_string) { #if defined(OS_WIN) - AppendSwitchNative(switch_string, base::ASCIIToWide(value_string)); + AppendSwitchNative(switch_string, ASCIIToWide(value_string)); #elif defined(OS_POSIX) AppendSwitchNative(switch_string, value_string); #endif @@ -387,7 +388,7 @@ CommandLine::StringVector CommandLine::GetArgs() const { void CommandLine::AppendArg(const std::string& value) { #if defined(OS_WIN) DCHECK(IsStringUTF8(value)); - AppendArgNative(base::UTF8ToWide(value)); + AppendArgNative(UTF8ToWide(value)); #elif defined(OS_POSIX) AppendArgNative(value); #endif @@ -414,7 +415,7 @@ void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) { // The wrapper may have embedded arguments (like "gdb --args"). In this case, // we don't pretend to do anything fancy, we just split on spaces. StringVector wrapper_argv; - base::SplitString(wrapper, FILE_PATH_LITERAL(' '), &wrapper_argv); + SplitString(wrapper, FILE_PATH_LITERAL(' '), &wrapper_argv); // Prepend the wrapper and update the switches/arguments |begin_args_|. argv_.insert(argv_.begin(), wrapper_argv.begin(), wrapper_argv.end()); begin_args_ += wrapper_argv.size(); @@ -423,7 +424,7 @@ void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) { #if defined(OS_WIN) void CommandLine::ParseFromString(const std::wstring& command_line) { std::wstring command_line_string; - base::TrimWhitespace(command_line, base::TRIM_ALL, &command_line_string); + TrimWhitespace(command_line, TRIM_ALL, &command_line_string); if (command_line_string.empty()) return; @@ -432,8 +433,10 @@ void CommandLine::ParseFromString(const std::wstring& command_line) { args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " - << command_line; + << UTF16ToUTF8(command_line); InitFromArgv(num_args, args); LocalFree(args); } #endif + +} // namespace base diff --git a/base/command_line.h b/base/command_line.h index 81bd4b7..fd06e61 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -24,8 +24,8 @@ #include "build/build_config.h" namespace base { + class FilePath; -} class BASE_EXPORT CommandLine { public: @@ -45,7 +45,7 @@ class BASE_EXPORT CommandLine { explicit CommandLine(NoProgram no_program); // Construct a new command line with |program| as argv[0]. - explicit CommandLine(const base::FilePath& program); + explicit CommandLine(const FilePath& program); // Construct a new command line from an argument list. CommandLine(int argc, const CharType* const* argv); @@ -108,8 +108,8 @@ class BASE_EXPORT CommandLine { const StringVector& argv() const { return argv_; } // Get and Set the program part of the command line string (the first item). - base::FilePath GetProgram() const; - void SetProgram(const base::FilePath& program); + FilePath GetProgram() const; + void SetProgram(const FilePath& program); // Returns true if this command line contains the given switch. // (Switch names are case-insensitive). @@ -118,7 +118,7 @@ class BASE_EXPORT CommandLine { // Returns the value associated with the given switch. If the switch has no // value or isn't present, this method returns the empty string. std::string GetSwitchValueASCII(const std::string& switch_string) const; - base::FilePath GetSwitchValuePath(const std::string& switch_string) const; + FilePath GetSwitchValuePath(const std::string& switch_string) const; StringType GetSwitchValueNative(const std::string& switch_string) const; // Get a copy of all switches, along with their values. @@ -128,7 +128,7 @@ class BASE_EXPORT CommandLine { // Note: Switches will precede arguments regardless of appending order. void AppendSwitch(const std::string& switch_string); void AppendSwitchPath(const std::string& switch_string, - const base::FilePath& path); + const FilePath& path); void AppendSwitchNative(const std::string& switch_string, const StringType& value); void AppendSwitchASCII(const std::string& switch_string, @@ -148,7 +148,7 @@ class BASE_EXPORT CommandLine { // AppendArg is primarily for ASCII; non-ASCII input is interpreted as UTF-8. // Note: Switches will precede arguments regardless of appending order. void AppendArg(const std::string& value); - void AppendArgPath(const base::FilePath& value); + void AppendArgPath(const FilePath& value); void AppendArgNative(const StringType& value); // Append the switches and arguments from another command line to this one. @@ -186,4 +186,9 @@ class BASE_EXPORT CommandLine { size_t begin_args_; }; +} // namespace base + +// TODO(brettw) remove once all callers specify the namespace properly. +using base::CommandLine; + #endif // BASE_COMMAND_LINE_H_ diff --git a/base/mac/launch_services_util.h b/base/mac/launch_services_util.h index d4aa9ff..0c52ca9 100644 --- a/base/mac/launch_services_util.h +++ b/base/mac/launch_services_util.h @@ -22,7 +22,7 @@ namespace mac { // |out_psn|, if not NULL, will be set to the process serial number of the // application's main process if the app was successfully launched. // Returns true if the app was successfully launched. -BASE_EXPORT bool OpenApplicationWithPath(const base::FilePath& bundle_path, +BASE_EXPORT bool OpenApplicationWithPath(const FilePath& bundle_path, const CommandLine& command_line, LSLaunchFlags launch_flags, ProcessSerialNumber* out_psn); diff --git a/base/process/launch.h b/base/process/launch.h index c25a9be..d725e05 100644 --- a/base/process/launch.h +++ b/base/process/launch.h @@ -24,10 +24,10 @@ #include "base/win/scoped_handle.h" #endif -class CommandLine; - namespace base { +class CommandLine; + #if defined(OS_WIN) typedef std::vector<HANDLE> HandlesToInheritVector; #endif diff --git a/base/test/launcher/test_launcher.h b/base/test/launcher/test_launcher.h index 796619d..ec0b2c1 100644 --- a/base/test/launcher/test_launcher.h +++ b/base/test/launcher/test_launcher.h @@ -16,8 +16,6 @@ #include "base/time/time.h" #include "base/timer/timer.h" -class CommandLine; - namespace testing { class TestCase; class TestInfo; @@ -25,6 +23,7 @@ class TestInfo; namespace base { +class CommandLine; struct LaunchOptions; class SequencedWorkerPoolOwner; class TestLauncher; diff --git a/base/test/launcher/test_results_tracker.h b/base/test/launcher/test_results_tracker.h index dbf3d04..8efce21 100644 --- a/base/test/launcher/test_results_tracker.h +++ b/base/test/launcher/test_results_tracker.h @@ -14,10 +14,9 @@ #include "base/test/launcher/test_result.h" #include "base/threading/thread_checker.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; // A helper class to output results. diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h index a47ef74..b830f73 100644 --- a/base/test/multiprocess_test.h +++ b/base/test/multiprocess_test.h @@ -13,10 +13,10 @@ #include "build/build_config.h" #include "testing/platform_test.h" -class CommandLine; - namespace base { +class CommandLine; + // Helpers to spawn a child for a multiprocess test and execute a designated // function. Use these when you already have another base class for your test // fixture, but you want (some) of your tests to be multiprocess (otherwise you diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index be19f7b..c5f62a8 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -537,8 +537,9 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { } #if defined(OS_MACOSX) -void ChromeMainDelegate::InitMacCrashReporter(const CommandLine& command_line, - const std::string& process_type) { +void ChromeMainDelegate::InitMacCrashReporter( + const base::CommandLine& command_line, + const std::string& process_type) { // TODO(mark): Right now, InitCrashReporter() needs to be called after // CommandLine::Init() and chrome::RegisterPathProvider(). Ideally, // Breakpad initialization could occur sooner, preferably even before the diff --git a/chrome/app/chrome_main_delegate.h b/chrome/app/chrome_main_delegate.h index f4a105b..5b651fe 100644 --- a/chrome/app/chrome_main_delegate.h +++ b/chrome/app/chrome_main_delegate.h @@ -10,6 +10,10 @@ #include "chrome/common/chrome_content_client.h" #include "content/public/app/content_main_delegate.h" +namespace base { +class CommandLine; +} + // Chrome implementation of ContentMainDelegate. class ChromeMainDelegate : public content::ContentMainDelegate { public: @@ -42,7 +46,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { virtual content::ContentUtilityClient* CreateContentUtilityClient() OVERRIDE; #if defined(OS_MACOSX) - void InitMacCrashReporter(const CommandLine& command_line, + void InitMacCrashReporter(const base::CommandLine& command_line, const std::string& process_type); #endif // defined(OS_MACOSX) diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h index 8856c9e..55859db 100644 --- a/chrome/browser/about_flags.h +++ b/chrome/browser/about_flags.h @@ -112,13 +112,14 @@ enum SentinelsMode { kNoSentinels, kAddSentinels }; // Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the // commandline flags belonging to the active experiments to |command_line|. void ConvertFlagsToSwitches(FlagsStorage* flags_storage, - CommandLine* command_line, + base::CommandLine* command_line, SentinelsMode sentinels); // Compares a set of switches of the two provided command line objects and // returns true if they are the same and false otherwise. bool AreSwitchesIdenticalToCurrentCommandLine( - const CommandLine& new_cmdline, const CommandLine& active_cmdline); + const base::CommandLine& new_cmdline, + const base::CommandLine& active_cmdline); // 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 @@ -145,7 +146,7 @@ void SetExperimentEnabled(FlagsStorage* flags_storage, // Removes all switches that were added to a command line by a previous call to // |ConvertFlagsToSwitches()|. void RemoveFlagsSwitches( - std::map<std::string, CommandLine::StringType>* switch_list); + std::map<std::string, base::CommandLine::StringType>* switch_list); // Reset all flags to the default state by clearing all flags. void ResetAllFlags(FlagsStorage* flags_storage); diff --git a/chrome/browser/apps/app_browsertest_util.h b/chrome/browser/apps/app_browsertest_util.h index 6c1c3c8..6dc8da8 100644 --- a/chrome/browser/apps/app_browsertest_util.h +++ b/chrome/browser/apps/app_browsertest_util.h @@ -9,12 +9,15 @@ #include "chrome/browser/extensions/extension_apitest.h" #include "content/public/common/page_transition_types.h" +namespace base { +class CommandLine; +} + namespace content { class WebContents; } class Browser; -class CommandLine; namespace extensions { class Extension; @@ -23,7 +26,7 @@ class PlatformAppBrowserTest : public ExtensionApiTest { public: PlatformAppBrowserTest(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; // Gets the first app window that is found for a given browser. static apps::AppWindow* GetFirstAppWindowForBrowser(Browser* browser); @@ -107,7 +110,7 @@ class PlatformAppBrowserTest : public ExtensionApiTest { class ExperimentalPlatformAppBrowserTest : public PlatformAppBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h index 87f5d97..05f0953 100644 --- a/chrome/browser/background/background_contents_service.h +++ b/chrome/browser/background/background_contents_service.h @@ -19,11 +19,11 @@ #include "ui/base/window_open_disposition.h" #include "url/gurl.h" -class CommandLine; class PrefService; class Profile; namespace base { +class CommandLine; class DictionaryValue; } @@ -53,7 +53,8 @@ class BackgroundContentsService : private content::NotificationObserver, public BackgroundContents::Delegate, public KeyedService { public: - BackgroundContentsService(Profile* profile, const CommandLine* command_line); + BackgroundContentsService(Profile* profile, + const base::CommandLine* command_line); virtual ~BackgroundContentsService(); // Allows tests to reduce the time between a force-installed app/extension diff --git a/chrome/browser/background/background_mode_manager.h b/chrome/browser/background/background_mode_manager.h index ae9bd48..4d87aca1 100644 --- a/chrome/browser/background/background_mode_manager.h +++ b/chrome/browser/background/background_mode_manager.h @@ -20,13 +20,16 @@ #include "content/public/browser/notification_registrar.h" class Browser; -class CommandLine; class PrefRegistrySimple; class Profile; class ProfileInfoCache; class StatusIcon; class StatusTray; +namespace base { +class CommandLine; +} + namespace extensions { class Extension; } @@ -54,7 +57,7 @@ class BackgroundModeManager public ProfileInfoCacheObserver, public StatusIconMenuModel::Delegate { public: - BackgroundModeManager(CommandLine* command_line, + BackgroundModeManager(base::CommandLine* command_line, ProfileInfoCache* profile_cache); virtual ~BackgroundModeManager(); diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 9120e7c..f6d7dc6 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -23,7 +23,6 @@ class ChromeNetLog; class ChromeResourceDispatcherHostDelegate; -class CommandLine; class RemoteDebuggingServer; class PrefRegistrySimple; class PromoResourceService; @@ -33,6 +32,7 @@ class PluginsResourceService; #endif namespace base { +class CommandLine; class SequencedTaskRunner; } @@ -51,7 +51,7 @@ class BrowserProcessImpl : public BrowserProcess, public: // |local_state_task_runner| must be a shutdown-blocking task runner. BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, - const CommandLine& command_line); + const base::CommandLine& command_line); virtual ~BrowserProcessImpl(); // Called before the browser threads are created. diff --git a/chrome/browser/browser_process_platform_part_aurawin.h b/chrome/browser/browser_process_platform_part_aurawin.h index 4d202dd..dcf85cf 100644 --- a/chrome/browser/browser_process_platform_part_aurawin.h +++ b/chrome/browser/browser_process_platform_part_aurawin.h @@ -24,7 +24,7 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase, // Overridden from BrowserProcessPlatformPartBase: virtual void PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) OVERRIDE; + const base::CommandLine& command_line) OVERRIDE; // content::NotificationObserver method: virtual void Observe(int type, diff --git a/chrome/browser/browser_process_platform_part_base.cc b/chrome/browser/browser_process_platform_part_base.cc index da263bf..ea65af3 100644 --- a/chrome/browser/browser_process_platform_part_base.cc +++ b/chrome/browser/browser_process_platform_part_base.cc @@ -20,7 +20,7 @@ BrowserProcessPlatformPartBase::~BrowserProcessPlatformPartBase() { } void BrowserProcessPlatformPartBase::PlatformSpecificCommandLineProcessing( - const CommandLine& /* command_line */) { + const base::CommandLine& /* command_line */) { } void BrowserProcessPlatformPartBase::StartTearDown() { diff --git a/chrome/browser/browser_process_platform_part_base.h b/chrome/browser/browser_process_platform_part_base.h index 28150e5..6ae847f 100644 --- a/chrome/browser/browser_process_platform_part_base.h +++ b/chrome/browser/browser_process_platform_part_base.h @@ -8,7 +8,9 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" +namespace base { class CommandLine; +} namespace policy { class BrowserPolicyConnector; @@ -24,7 +26,7 @@ class BrowserProcessPlatformPartBase { // Called after creating the process singleton or when another chrome // rendez-vous with this one. virtual void PlatformSpecificCommandLineProcessing( - const CommandLine& command_line); + const base::CommandLine& command_line); // Called from BrowserProcessImpl::StartTearDown(). virtual void StartTearDown(); diff --git a/chrome/browser/chrome_browser_field_trials.h b/chrome/browser/chrome_browser_field_trials.h index bab7aba..515b514 100644 --- a/chrome/browser/chrome_browser_field_trials.h +++ b/chrome/browser/chrome_browser_field_trials.h @@ -12,7 +12,7 @@ class PrefService; class ChromeBrowserFieldTrials { public: - explicit ChromeBrowserFieldTrials(const CommandLine& command_line); + explicit ChromeBrowserFieldTrials(const base::CommandLine& command_line); ~ChromeBrowserFieldTrials(); // Called by the browser main sequence to set up Field Trials for this client. @@ -24,7 +24,7 @@ class ChromeBrowserFieldTrials { // reported as used. void InstantiateDynamicTrials(); - const CommandLine& parsed_command_line_; + const base::CommandLine& parsed_command_line_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); }; diff --git a/chrome/browser/chrome_browser_field_trials_desktop.h b/chrome/browser/chrome_browser_field_trials_desktop.h index 2668e7e..141e01f 100644 --- a/chrome/browser/chrome_browser_field_trials_desktop.h +++ b/chrome/browser/chrome_browser_field_trials_desktop.h @@ -8,9 +8,12 @@ #include "base/basictypes.h" #include "base/time/time.h" -class CommandLine; class PrefService; +namespace base { +class CommandLine; +} + namespace chrome { // Sets up common desktop-only field trials. @@ -18,7 +21,7 @@ namespace chrome { // SetupFieldTrials in chrome_browser_field_trials.cc if it is for all // platforms. // |local_state| is needed by some other methods called from within this one. -void SetupDesktopFieldTrials(const CommandLine& parsed_command_line, +void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line, const base::Time& install_time, PrefService* local_state); diff --git a/chrome/browser/chrome_browser_field_trials_mobile.h b/chrome/browser/chrome_browser_field_trials_mobile.h index dac9603..dc5f278 100644 --- a/chrome/browser/chrome_browser_field_trials_mobile.h +++ b/chrome/browser/chrome_browser_field_trials_mobile.h @@ -8,16 +8,19 @@ #include "base/basictypes.h" #include "base/time/time.h" -class CommandLine; class PrefService; +namespace base { +class CommandLine; +} + namespace chrome { // Sets up mobile-only field trials. // Add an invocation of your field trial init function to this method, or to // SetupFieldTrials in chrome_browser_field_trials.cc if it is for all // platforms. -void SetupMobileFieldTrials(const CommandLine& parsed_command_line, +void SetupMobileFieldTrials(const base::CommandLine& parsed_command_line, const base::Time& install_time, PrefService* local_state); diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h index 8ea91ed..be706ab 100644 --- a/chrome/browser/chrome_browser_main.h +++ b/chrome/browser/chrome_browser_main.h @@ -87,7 +87,7 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { const content::MainFunctionParams& parameters() const { return parameters_; } - const CommandLine& parsed_command_line() const { + const base::CommandLine& parsed_command_line() const { return parsed_command_line_; } @@ -126,7 +126,7 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { // Members initialized on construction --------------------------------------- const content::MainFunctionParams parameters_; - const CommandLine& parsed_command_line_; + const base::CommandLine& parsed_command_line_; int result_code_; // Create StartupTimeBomb object for watching jank during startup. diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 170f92b..8ee1ec1 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h @@ -9,7 +9,9 @@ #include "chrome/browser/chrome_browser_main.h" +namespace base { class CommandLine; +} // Handle uninstallation when given the appropriate the command-line switch. // If |chrome_still_running| is true a modal dialog will be shown asking the @@ -37,18 +39,18 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { // environment block so they are accessible in the early stages of the // chrome executable's lifetime. static void PrepareRestartOnCrashEnviroment( - const CommandLine& parsed_command_line); + const base::CommandLine& parsed_command_line); // Registers Chrome with the Windows Restart Manager, which will restore the // Chrome session when the computer is restarted after a system update. static void RegisterApplicationRestart( - const CommandLine& parsed_command_line); + const base::CommandLine& parsed_command_line); // This method handles the --hide-icons and --show-icons command line options // for chrome that get triggered by Windows from registry entries // HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons // functionality so we just ask the users if they want to uninstall Chrome. - static int HandleIconsCommands(const CommandLine& parsed_command_line); + static int HandleIconsCommands(const base::CommandLine& parsed_command_line); // Check if there is any machine level Chrome installed on the current // machine. If yes and the current Chrome process is user level, we do not diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 834824c..9b5bf29 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -19,6 +19,10 @@ #include "base/memory/scoped_ptr.h" #endif +namespace base { +class CommandLine; +} + namespace content { class QuotaPermissionContext; } @@ -117,7 +121,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual bool ShouldAssignSiteForURL(const GURL& url) OVERRIDE; virtual std::string GetCanonicalEncodingNameByAliasName( const std::string& alias_name) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual std::string GetApplicationLocale() OVERRIDE; virtual std::string GetAcceptLangs( @@ -261,7 +265,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual void GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; #endif @@ -281,8 +285,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if defined(ENABLE_WEBRTC) // Copies disable WebRTC encryption switch depending on the channel. static void MaybeCopyDisableWebRtcEncryptionSwitch( - CommandLine* to_command_line, - const CommandLine& from_command_line, + base::CommandLine* to_command_line, + const base::CommandLine& from_command_line, VersionInfo::Channel channel); #endif diff --git a/chrome/browser/chromeos/login/chrome_restart_request.h b/chrome/browser/chromeos/login/chrome_restart_request.h index 7e0311c..b9c9ba1 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.h +++ b/chrome/browser/chromeos/login/chrome_restart_request.h @@ -7,17 +7,20 @@ #include <string> -class CommandLine; class GURL; +namespace base { +class CommandLine; +} + namespace chromeos { // Returns the command line string to be used for the OTR process. Also modifies // the given command line. std::string GetOffTheRecordCommandLine( const GURL& start_url, - const CommandLine& base_command_line, - CommandLine* command_line); + const base::CommandLine& base_command_line, + base::CommandLine* command_line); // Request session manager to restart chrome with a new command line. void RestartChrome(const std::string& command_line); diff --git a/chrome/browser/chromeos/login/login_manager_test.h b/chrome/browser/chromeos/login/login_manager_test.h index 8504acb..b05db48 100644 --- a/chrome/browser/chromeos/login/login_manager_test.h +++ b/chrome/browser/chromeos/login/login_manager_test.h @@ -27,7 +27,7 @@ class LoginManagerTest : public InProcessBrowserTest { // Overriden from InProcessBrowserTest. virtual void CleanUpOnMainThread() OVERRIDE; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; diff --git a/chrome/browser/chromeos/login/login_utils.h b/chrome/browser/chromeos/login/login_utils.h index 7f70196..0b57f90 100644 --- a/chrome/browser/chromeos/login/login_utils.h +++ b/chrome/browser/chromeos/login/login_utils.h @@ -9,12 +9,15 @@ #include "base/memory/ref_counted.h" -class CommandLine; class GURL; class PrefRegistrySimple; class PrefService; class Profile; +namespace base { +class CommandLine; +} + namespace chromeos { class Authenticator; diff --git a/chrome/browser/chromeos/login/oobe_base_test.h b/chrome/browser/chromeos/login/oobe_base_test.h index ae36c3b..f5caf7d 100644 --- a/chrome/browser/chromeos/login/oobe_base_test.h +++ b/chrome/browser/chromeos/login/oobe_base_test.h @@ -39,7 +39,7 @@ class OobeBaseTest : public ExtensionApiTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; virtual void CleanUpOnMainThread() OVERRIDE; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; // Network status control functions. void SimulateNetworkOffline(); diff --git a/chrome/browser/chromeos/login/wallpaper_manager.h b/chrome/browser/chromeos/login/wallpaper_manager.h index 56b5433..936a54c 100644 --- a/chrome/browser/chromeos/login/wallpaper_manager.h +++ b/chrome/browser/chromeos/login/wallpaper_manager.h @@ -26,10 +26,10 @@ #include "third_party/icu/source/i18n/unicode/timezone.h" #include "ui/gfx/image/image_skia.h" -class CommandLine; class PrefRegistrySimple; namespace base { +class CommandLine; class SequencedTaskRunner; } @@ -171,7 +171,7 @@ class WallpaperManager: public content::NotificationObserver { WallpaperManager(); virtual ~WallpaperManager(); - void set_command_line_for_testing(CommandLine* command_line) { + void set_command_line_for_testing(base::CommandLine* command_line) { command_line_for_testing_ = command_line; } @@ -354,7 +354,7 @@ class WallpaperManager: public content::NotificationObserver { void EnsureCustomWallpaperDirectories(const std::string& user_id_hash); // Gets the CommandLine representing the current process's command line. - CommandLine* GetComandLine(); + base::CommandLine* GetComandLine(); // Initialize wallpaper of registered device after device policy is trusted. // Note that before device is enrolled, it proceeds with untrusted setting. @@ -481,7 +481,7 @@ class WallpaperManager: public content::NotificationObserver { WallpaperInfo current_user_wallpaper_info_; // If non-NULL, used in place of the real command line. - CommandLine* command_line_for_testing_; + base::CommandLine* command_line_for_testing_; // Caches wallpapers of users. Accessed only on UI thread. CustomWallpaperMap wallpaper_cache_; diff --git a/chrome/browser/chromeos/login/wizard_in_process_browser_test.h b/chrome/browser/chromeos/login/wizard_in_process_browser_test.h index 019edf8..84c2759 100644 --- a/chrome/browser/chromeos/login/wizard_in_process_browser_test.h +++ b/chrome/browser/chromeos/login/wizard_in_process_browser_test.h @@ -36,7 +36,7 @@ class WizardInProcessBrowserTest : public InProcessBrowserTest { // Overriden from InProcessBrowserTest: virtual void SetUpOnMainThread() OVERRIDE; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void CleanUpOnMainThread() OVERRIDE; private: diff --git a/chrome/browser/component_updater/component_updater_configurator.h b/chrome/browser/component_updater/component_updater_configurator.h index 8e59d1f..da8a046 100644 --- a/chrome/browser/component_updater/component_updater_configurator.h +++ b/chrome/browser/component_updater/component_updater_configurator.h @@ -7,7 +7,9 @@ #include "chrome/browser/component_updater/component_updater_service.h" +namespace base { class CommandLine; +} namespace net { class URLRequestContextGetter; @@ -16,7 +18,8 @@ class URLRequestContextGetter; namespace component_updater { ComponentUpdateService::Configurator* MakeChromeComponentUpdaterConfigurator( - const CommandLine* cmdline, net::URLRequestContextGetter* context_getter); + const base::CommandLine* cmdline, + net::URLRequestContextGetter* context_getter); } // namespace component_updater diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h index 822b0b5..ba5fd24 100644 --- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h +++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h @@ -15,9 +15,8 @@ #include "chrome/browser/component_updater/component_updater_service.h" #include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h" -class CommandLine; - namespace base { +class CommandLine; class DictionaryValue; } @@ -52,7 +51,7 @@ class PnaclComponentInstaller : public ComponentInstaller { // Register a PNaCl component for the first time. void RegisterPnaclComponent(ComponentUpdateService* cus, - const CommandLine& command_line); + const base::CommandLine& command_line); // Check the PNaCl version again and re-register with the component // updater service. diff --git a/chrome/browser/diagnostics/diagnostics_controller.h b/chrome/browser/diagnostics/diagnostics_controller.h index f5d3d22..7e7ee17 100644 --- a/chrome/browser/diagnostics/diagnostics_controller.h +++ b/chrome/browser/diagnostics/diagnostics_controller.h @@ -8,7 +8,9 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" +namespace base { class CommandLine; +} namespace diagnostics { @@ -21,11 +23,12 @@ class DiagnosticsController { // Entry point for the diagnostics mode. Returns zero if able to run // diagnostics successfully, regardless of the results of the diagnostics. - int Run(const CommandLine& command_line, DiagnosticsWriter* writer); + int Run(const base::CommandLine& command_line, DiagnosticsWriter* writer); // Entry point for running recovery based on diagnostics that have already // been run. In order for this to do anything, Run() must be executed first. - int RunRecovery(const CommandLine& command_line, DiagnosticsWriter* writer); + int RunRecovery(const base::CommandLine& command_line, + DiagnosticsWriter* writer); // Returns a model with the results that have accumulated. They can then be // queried for their attributes for human consumption later. diff --git a/chrome/browser/diagnostics/diagnostics_model.h b/chrome/browser/diagnostics/diagnostics_model.h index 1727aaa..334c284 100644 --- a/chrome/browser/diagnostics/diagnostics_model.h +++ b/chrome/browser/diagnostics/diagnostics_model.h @@ -8,7 +8,9 @@ #include <string> #include "base/time/time.h" +namespace base { class CommandLine; +} namespace diagnostics { @@ -100,7 +102,7 @@ class DiagnosticsModel { // The factory for the model. The main purpose is to hide the creation of // different models for different platforms. -DiagnosticsModel* MakeDiagnosticsModel(const CommandLine& cmdline); +DiagnosticsModel* MakeDiagnosticsModel(const base::CommandLine& cmdline); } // namespace diagnostics diff --git a/chrome/browser/extensions/api/command_line_private/command_line_private_apitest.cc b/chrome/browser/extensions/api/command_line_private/command_line_private_apitest.cc index f8fe90d..ec14fd3 100644 --- a/chrome/browser/extensions/api/command_line_private/command_line_private_apitest.cc +++ b/chrome/browser/extensions/api/command_line_private/command_line_private_apitest.cc @@ -12,7 +12,7 @@ const char kTestCommandLineSwitch[] = "command-line-private-api-test-foo"; } // namespace class CommandLinePrivateApiTest : public ExtensionApiTest { - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { ExtensionApiTest::SetUpCommandLine(command_line); command_line->AppendSwitch(kTestCommandLineSwitch); } diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.h b/chrome/browser/extensions/api/messaging/native_process_launcher.h index 601823d..6694bdc 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.h +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.h @@ -11,10 +11,10 @@ #include "base/process/process.h" #include "ui/gfx/native_widget_types.h" -class CommandLine; class GURL; namespace base { +class CommandLine; class FilePath; } @@ -67,7 +67,7 @@ class NativeProcessLauncher { std::string* error_message); // Launches native messaging process. - static bool LaunchNativeProcess(const CommandLine& command_line, + static bool LaunchNativeProcess(const base::CommandLine& command_line, base::ProcessHandle* process_handle, base::PlatformFile* read_file, base::PlatformFile* write_file); diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.h b/chrome/browser/extensions/chrome_extensions_browser_client.h index c81edf4..b720897 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.h +++ b/chrome/browser/extensions/chrome_extensions_browser_client.h @@ -12,7 +12,9 @@ #include "chrome/browser/extensions/chrome_notification_observer.h" #include "extensions/browser/extensions_browser_client.h" +namespace base { class CommandLine; +} namespace content { class BrowserContext; @@ -35,7 +37,7 @@ class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { // BrowserClient overrides: virtual bool IsShuttingDown() OVERRIDE; - virtual bool AreExtensionsDisabled(const CommandLine& command_line, + virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, content::BrowserContext* context) OVERRIDE; virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; virtual bool IsSameContext(content::BrowserContext* first, diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index a6518c6..1978b87 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h @@ -188,7 +188,7 @@ class ExtensionApiTest : public ExtensionBrowserTest { const extensions::Extension* GetSingleLoadedExtension(); // All extensions tested by ExtensionApiTest are in the "api_test" dir. - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; // If it failed, what was the error message? std::string message_; diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h index 0588a21..67c32cd 100644 --- a/chrome/browser/extensions/extension_browsertest.h +++ b/chrome/browser/extensions/extension_browsertest.h @@ -75,7 +75,7 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest { // InProcessBrowserTest virtual void SetUp() OVERRIDE; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; const extensions::Extension* LoadExtension(const base::FilePath& path); diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 6a859c5c..5956f48 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -36,13 +36,13 @@ #include "extensions/common/manifest_handlers/shared_module_info.h" #include "extensions/common/one_shot_event.h" -class CommandLine; class ExtensionErrorUI; class ExtensionToolbarModel; class GURL; class Profile; namespace base { +class CommandLine; class SequencedTaskRunner; class Version; } @@ -152,7 +152,7 @@ class ExtensionService // Constructor stores pointers to |profile| and |extension_prefs| but // ownership remains at caller. ExtensionService(Profile* profile, - const CommandLine* command_line, + const base::CommandLine* command_line, const base::FilePath& install_directory, extensions::ExtensionPrefs* extension_prefs, extensions::Blacklist* blacklist, diff --git a/chrome/browser/extensions/startup_helper.h b/chrome/browser/extensions/startup_helper.h index 6844194..9efb7cb 100644 --- a/chrome/browser/extensions/startup_helper.h +++ b/chrome/browser/extensions/startup_helper.h @@ -8,9 +8,12 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/extensions/pack_extension_job.h" -class CommandLine; class Profile; +namespace base { +class CommandLine; +} + namespace extensions { // Initialization helpers for various Extension startup actions. @@ -27,23 +30,23 @@ class StartupHelper : public PackExtensionJob::Client { // Handle --pack-extension flag from the |cmd_line| by packing the specified // extension. Returns false if the pack job failed. - bool PackExtension(const CommandLine& cmd_line); + bool PackExtension(const base::CommandLine& cmd_line); // Validates a crx at the path given by the --validate-extension flag - can // it be installed? Returns true if the crx is valid, or false otherwise. // If the return value is false, a description of the problem may be written // into |error|. - bool ValidateCrx(const CommandLine& cmd_line, std::string* error); + bool ValidateCrx(const base::CommandLine& cmd_line, std::string* error); // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the // specified extension from |profile|. Returns false if the uninstall job // could not be started. - bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); + bool UninstallExtension(const base::CommandLine& cmd_line, Profile* profile); // Handle --install-from-webstore flag from |cmd_line| by downloading // metadata from the webstore for the given id, prompting the user to // confirm, and then downloading the crx and installing it. - bool InstallFromWebstore(const CommandLine& cmd_line, Profile* profile); + bool InstallFromWebstore(const base::CommandLine& cmd_line, Profile* profile); // Handle --limited-install-from-webstore flag from |cmd_line| by downloading // metadata from the webstore for the given id, prompting the user to @@ -51,12 +54,14 @@ class StartupHelper : public PackExtensionJob::Client { // This whole process is only kicked off by this function and completed // asynchronously unlike InstallFromWebstore which finishes everything before // returning. - void LimitedInstallFromWebstore(const CommandLine& cmd_line, Profile* profile, + void LimitedInstallFromWebstore(const base::CommandLine& cmd_line, + Profile* profile, base::Callback<void()> done_callback); // Maps the command line argument to the extension id. Returns an empty string // in the case when there is no mapping. - std::string WebStoreIdFromLimitedInstallCmdLine(const CommandLine& cmd_line); + std::string WebStoreIdFromLimitedInstallCmdLine( + const base::CommandLine& cmd_line); private: scoped_refptr<PackExtensionJob> pack_job_; bool pack_job_succeeded_; diff --git a/chrome/browser/extensions/test_extension_system.h b/chrome/browser/extensions/test_extension_system.h index 6732f68..ad5375a 100644 --- a/chrome/browser/extensions/test_extension_system.h +++ b/chrome/browser/extensions/test_extension_system.h @@ -8,11 +8,11 @@ #include "extensions/browser/extension_system.h" #include "extensions/common/one_shot_event.h" -class CommandLine; class Profile; class TestingValueStore; namespace base { +class CommandLine; class FilePath; class Time; } @@ -38,13 +38,13 @@ class TestExtensionSystem : public ExtensionSystem { // Creates an ExtensionPrefs with the testing profile and returns it. // Useful for tests that need to modify prefs before creating the // ExtensionService. - ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, + ExtensionPrefs* CreateExtensionPrefs(const base::CommandLine* command_line, const base::FilePath& install_directory); // Creates an ExtensionService initialized with the testing profile and // returns it, and creates ExtensionPrefs if it hasn't been created yet. ExtensionService* CreateExtensionService( - const CommandLine* command_line, + const base::CommandLine* command_line, const base::FilePath& install_directory, bool autoupdate_enabled); diff --git a/chrome/browser/extensions/webstore_installer_test.h b/chrome/browser/extensions/webstore_installer_test.h index 40518ba..00a7ae8 100644 --- a/chrome/browser/extensions/webstore_installer_test.h +++ b/chrome/browser/extensions/webstore_installer_test.h @@ -23,7 +23,7 @@ class WebstoreInstallerTest : public InProcessBrowserTest { const std::string& unverified_domain); virtual ~WebstoreInstallerTest(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; protected: diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc index ed5ea91..77443a6 100644 --- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc +++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc @@ -56,7 +56,7 @@ class WebstoreStartupInstallerTest : public WebstoreInstallerTest { }; IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, Install) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); ui_test_utils::NavigateToURL( @@ -71,7 +71,7 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, Install) { IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallNotAllowedFromNonVerifiedDomains) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); ui_test_utils::NavigateToURL( browser(), @@ -91,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, FindLink) { // Flakes on all platforms: http://crbug.com/95713, http://crbug.com/229947 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, DISABLED_ArgumentValidation) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); // Each of these tests has to run separately, since one page/tab can @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, } IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, MultipleInstallCalls) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); ui_test_utils::NavigateToURL( @@ -118,7 +118,7 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, MultipleInstallCalls) { } IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallNotSupported) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); ui_test_utils::NavigateToURL( browser(), @@ -138,7 +138,7 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallNotSupported) { // Regression test for http://crbug.com/144991. IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallFromHostedApp) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); const GURL kInstallUrl = GenerateTestServerUrl(kAppDomain, "install.html"); @@ -175,7 +175,7 @@ class WebstoreStartupInstallerManagedUsersTest : public WebstoreStartupInstallerTest { public: // InProcessBrowserTest overrides: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { WebstoreStartupInstallerTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); } @@ -185,11 +185,12 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerManagedUsersTest, InstallProhibited) { #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 - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); ui_test_utils::NavigateToURL( @@ -208,12 +209,12 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerManagedUsersTest, class WebstoreStartupInstallUnpackFailureTest : public WebstoreStartupInstallerTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { WebstoreStartupInstallerTest::SetUpCommandLine(command_line); GURL crx_url = GenerateTestServerUrl( kWebstoreDomain, "malformed_extension.crx"); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryUpdateURL, crx_url.spec()); } @@ -225,7 +226,7 @@ class WebstoreStartupInstallUnpackFailureTest IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallUnpackFailureTest, WebstoreStartupInstallUnpackFailureTest) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); ui_test_utils::NavigateToURL(browser(), @@ -280,7 +281,7 @@ class CommandLineWebstoreInstall : public WebstoreStartupInstallerTest, }; IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, Accept) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII( switches::kInstallFromWebstore, kTestExtensionId); command_line->AppendSwitchASCII( @@ -292,7 +293,7 @@ IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, Accept) { } IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, Cancel) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII( switches::kInstallFromWebstore, kTestExtensionId); command_line->AppendSwitchASCII( @@ -308,20 +309,20 @@ IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedAccept) { // Small test of "WebStoreIdFromLimitedInstallCmdLine" which made more // sense together with the rest of the test for "LimitedInstallFromWebstore". - CommandLine command_line_test1(CommandLine::NO_PROGRAM); + base::CommandLine command_line_test1(base::CommandLine::NO_PROGRAM); command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore, "1"); EXPECT_EQ("nckgahadagoaajjgafhacjanaoiihapd", helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1)); - CommandLine command_line_test2(CommandLine::NO_PROGRAM); + base::CommandLine command_line_test2(base::CommandLine::NO_PROGRAM); command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore, "2"); EXPECT_EQ(kTestExtensionId, helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1)); // Now, on to the real test for LimitedInstallFromWebstore. - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII( switches::kLimitedInstallFromWebstore, "2"); helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h index 6932b3a..f9683fa 100644 --- a/chrome/browser/first_run/first_run.h +++ b/chrome/browser/first_run/first_run.h @@ -10,11 +10,11 @@ #include "base/basictypes.h" -class CommandLine; class GURL; class Profile; namespace base { +class CommandLine; class FilePath; } @@ -88,7 +88,7 @@ bool IsChromeFirstRun(); // Returns true if |command_line|'s switches explicitly specify that first run // should be suppressed in the current run. -bool IsFirstRunSuppressed(const CommandLine& command_line); +bool IsFirstRunSuppressed(const base::CommandLine& command_line); // Creates the first run sentinel if needed. This should only be called after // the process singleton has been grabbed by the current process diff --git a/chrome/browser/first_run/upgrade_util.h b/chrome/browser/first_run/upgrade_util.h index ec8a1ce..700b2b4 100644 --- a/chrome/browser/first_run/upgrade_util.h +++ b/chrome/browser/first_run/upgrade_util.h @@ -13,13 +13,15 @@ #if !defined(OS_CHROMEOS) +namespace base { class CommandLine; +} namespace upgrade_util { // Launches Chrome again simulating a "user" launch. If Chrome could not be // launched, returns false. -bool RelaunchChromeBrowser(const CommandLine& command_line); +bool RelaunchChromeBrowser(const base::CommandLine& command_line); #if defined(OS_WIN) @@ -40,14 +42,14 @@ RelaunchMode RelaunchModeStringToEnum(const std::string& relaunch_mode); // Like RelaunchChromeBrowser() but for Windows 8 it will read pref and restart // chrome accordingly in desktop or metro mode. -bool RelaunchChromeWithMode(const CommandLine& command_line, +bool RelaunchChromeWithMode(const base::CommandLine& command_line, const RelaunchMode& relaunch_mode); #endif #if !defined(OS_MACOSX) -void SetNewCommandLine(CommandLine* new_command_line); +void SetNewCommandLine(base::CommandLine* new_command_line); // Launches a new instance of the browser if the current instance in persistent // mode an upgrade is detected. diff --git a/chrome/browser/first_run/upgrade_util_win.h b/chrome/browser/first_run/upgrade_util_win.h index af0f844..c5a5d5c 100644 --- a/chrome/browser/first_run/upgrade_util_win.h +++ b/chrome/browser/first_run/upgrade_util_win.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_WIN_H_ #define CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_WIN_H_ +namespace base { class CommandLine; +} namespace upgrade_util { @@ -19,7 +21,7 @@ bool SwapNewChromeExeIfPresent(); // the browser. Note that relaunch does NOT exit the existing browser process. // If this is called before message loop is executed, simply exit the main // function. If browser is already running, you will need to exit it. -bool DoUpgradeTasks(const CommandLine& command_line); +bool DoUpgradeTasks(const base::CommandLine& command_line); } // namespace upgrade_util diff --git a/chrome/browser/invalidation/invalidation_service_util.h b/chrome/browser/invalidation/invalidation_service_util.h index 7f44c31..a18c7f5 100644 --- a/chrome/browser/invalidation/invalidation_service_util.h +++ b/chrome/browser/invalidation/invalidation_service_util.h @@ -7,12 +7,15 @@ #include "jingle/notifier/base/notifier_options.h" +namespace base { class CommandLine; +} namespace invalidation { // Parses the given command line for notifier options. -notifier::NotifierOptions ParseNotifierOptions(const CommandLine& command_line); +notifier::NotifierOptions ParseNotifierOptions( + const base::CommandLine& command_line); // Generates a unique client ID for the invalidator. std::string GenerateInvalidatorClientId(); diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index a41d83f..40bee1b 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -22,12 +22,15 @@ #include "net/socket/next_proto.h" class ChromeNetLog; -class CommandLine; class PrefProxyConfigTracker; class PrefService; class PrefRegistrySimple; class SystemURLRequestContextGetter; +namespace base { +class CommandLine; +} + namespace chrome_browser_net { class DnsProbeService; class HttpPipeliningCompatibilityClient; @@ -222,7 +225,7 @@ class IOThread : public content::BrowserThreadDelegate { virtual void InitAsync() OVERRIDE; virtual void CleanUp() OVERRIDE; - void InitializeNetworkOptions(const CommandLine& parsed_command_line); + void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); // Enable SPDY with the given mode, which may contain the following: // @@ -263,41 +266,41 @@ class IOThread : public content::BrowserThreadDelegate { // Configures QUIC options based on the flags in |command_line| as // well as the QUIC field trial group. - void ConfigureQuic(const CommandLine& command_line); + void ConfigureQuic(const base::CommandLine& command_line); // Returns true if QUIC should be enabled, either as a result // of a field trial or a command line flag. - bool ShouldEnableQuic(const CommandLine& command_line, + bool ShouldEnableQuic(const base::CommandLine& command_line, base::StringPiece quic_trial_group); // Returns true if HTTPS over QUIC should be enabled, either as a result // of a field trial or a command line flag. - bool ShouldEnableQuicHttps(const CommandLine& command_line, + bool ShouldEnableQuicHttps(const base::CommandLine& command_line, base::StringPiece quic_trial_group); // Returns true if the selection of the ephemeral port in bind() should be // performed by Chromium, and false if the OS should select the port. The OS // option is used to prevent Windows from posting a security security warning // dialog. - bool ShouldEnableQuicPortSelection(const CommandLine& command_line); + bool ShouldEnableQuicPortSelection(const base::CommandLine& command_line); // Returns true if QUIC packet pacing should be negotiated during the // QUIC handshake. - bool ShouldEnableQuicPacing(const CommandLine& command_line, + bool ShouldEnableQuicPacing(const base::CommandLine& command_line, base::StringPiece quic_trial_group); // Returns true if Chromium should persist QUIC server config information to // disk cache. - bool ShouldEnableQuicPersistServerInfo(const CommandLine& command_line); + bool ShouldEnableQuicPersistServerInfo(const base::CommandLine& command_line); // Returns the maximum length for QUIC packets, based on any flags in // |command_line| or the field trial. Returns 0 if there is an error // parsing any of the options, or if the default value should be used. - size_t GetQuicMaxPacketLength(const CommandLine& command_line, + size_t GetQuicMaxPacketLength(const base::CommandLine& command_line, base::StringPiece quic_trial_group); // Returns the quic versions specified by any flags in |command_line|. - net::QuicVersion GetQuicVersion(const CommandLine& command_line); + net::QuicVersion GetQuicVersion(const base::CommandLine& command_line); // The NetLog is owned by the browser process, to allow logging from other // threads during shutdown, but is used most frequently on the IOThread. diff --git a/chrome/browser/jankometer.h b/chrome/browser/jankometer.h index fe5d4f6..d4ce5ca 100644 --- a/chrome/browser/jankometer.h +++ b/chrome/browser/jankometer.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_JANKOMETER_H_ #define CHROME_BROWSER_JANKOMETER_H_ +namespace base { class CommandLine; +} // The Jank-O-Meter measures jankyness, which is user-perceivable lag in // responsiveness of the application. @@ -14,7 +16,7 @@ class CommandLine; // // This function will initialize the service, which will install itself in // critical threads. It should be called on the UI thread. -void InstallJankometer(const CommandLine& parsed_command_line); +void InstallJankometer(const base::CommandLine& parsed_command_line); // Clean up Jank-O-Meter junk void UninstallJankometer(); diff --git a/chrome/browser/jankometer_android.cc b/chrome/browser/jankometer_android.cc index 6a57f05..5979cf0 100644 --- a/chrome/browser/jankometer_android.cc +++ b/chrome/browser/jankometer_android.cc @@ -4,7 +4,7 @@ #include "chrome/browser/jankometer.h" -void InstallJankometer(const CommandLine& parsed_command_line) { +void InstallJankometer(const base::CommandLine& parsed_command_line) { } void UninstallJankometer() { diff --git a/chrome/browser/jankometer_mac.cc b/chrome/browser/jankometer_mac.cc index cf85869..882299a 100644 --- a/chrome/browser/jankometer_mac.cc +++ b/chrome/browser/jankometer_mac.cc @@ -4,7 +4,7 @@ #include "chrome/browser/jankometer.h" -void InstallJankometer(const CommandLine& parsed_command_line) { +void InstallJankometer(const base::CommandLine& parsed_command_line) { // TODO(port): Implement jankometer, http://crbug.com/8077 } diff --git a/chrome/browser/jumplist_updater_win.h b/chrome/browser/jumplist_updater_win.h index 16de382..283a270 100644 --- a/chrome/browser/jumplist_updater_win.h +++ b/chrome/browser/jumplist_updater_win.h @@ -30,7 +30,7 @@ class ShellLinkItem : public base::RefCountedThreadSafe<ShellLinkItem> { const SkBitmap& icon_data() const { return icon_data_; } std::wstring GetArguments() const; - CommandLine* GetCommandLine(); + base::CommandLine* GetCommandLine(); void set_title(const std::wstring& title) { title_ = title; @@ -50,7 +50,7 @@ class ShellLinkItem : public base::RefCountedThreadSafe<ShellLinkItem> { ~ShellLinkItem(); // Used for storing and appending command-line arguments. - CommandLine command_line_; + base::CommandLine command_line_; // The string to be displayed in a JumpList. std::wstring title_; diff --git a/chrome/browser/media/test_license_server_config.h b/chrome/browser/media/test_license_server_config.h index b25da78..e39c0e2 100644 --- a/chrome/browser/media/test_license_server_config.h +++ b/chrome/browser/media/test_license_server_config.h @@ -8,10 +8,10 @@ #include <string> #include "base/basictypes.h" -class CommandLine; namespace base { - class FilePath; +class CommandLine; +class FilePath; } // Class used to start a test license server. @@ -27,7 +27,7 @@ class TestLicenseServerConfig { // Returns true if it successfully sets the command line to run the license // server with needed args and switches. - virtual bool GetServerCommandLine(CommandLine* command_line) = 0; + virtual bool GetServerCommandLine(base::CommandLine* command_line) = 0; // Returns true if the server is supported on current platform. virtual bool IsPlatformSupported() = 0; diff --git a/chrome/browser/media/wv_test_license_server_config.h b/chrome/browser/media/wv_test_license_server_config.h index ecd7874..4acfd69 100644 --- a/chrome/browser/media/wv_test_license_server_config.h +++ b/chrome/browser/media/wv_test_license_server_config.h @@ -15,7 +15,7 @@ class WVTestLicenseServerConfig : public TestLicenseServerConfig { virtual std::string GetServerURL() OVERRIDE; - virtual bool GetServerCommandLine(CommandLine* command_line) OVERRIDE; + virtual bool GetServerCommandLine(base::CommandLine* command_line) OVERRIDE; virtual bool IsPlatformSupported() OVERRIDE; diff --git a/chrome/browser/metrics/thread_watcher.h b/chrome/browser/metrics/thread_watcher.h index 94d5248..4cd2f92 100644 --- a/chrome/browser/metrics/thread_watcher.h +++ b/chrome/browser/metrics/thread_watcher.h @@ -381,7 +381,7 @@ class ThreadWatcherList { // This method posts a task on WatchDogThread to start watching all browser // threads. // This method is accessible on UI thread. - static void StartWatchingAll(const CommandLine& command_line); + static void StartWatchingAll(const base::CommandLine& command_line); // This method posts a task on WatchDogThread to RevokeAll tasks and to // deactive thread watching of other threads and tell NotificationService to @@ -425,7 +425,7 @@ class ThreadWatcherList { // switches::kCrashOnHangThreads. |crash_on_hang_threads| is a map of // |crash_on_hang| thread's names to |CrashDataThresholds|. static void ParseCommandLine( - const CommandLine& command_line, + const base::CommandLine& command_line, uint32* unresponsive_threshold, CrashOnHangThreadMap* crash_on_hang_threads); diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/proxy_service_factory.h index 3d3b0d9..b91c2e3 100644 --- a/chrome/browser/net/proxy_service_factory.h +++ b/chrome/browser/net/proxy_service_factory.h @@ -7,10 +7,13 @@ #include "base/basictypes.h" -class CommandLine; class PrefProxyConfigTracker; class PrefService; +namespace base { +class CommandLine; +} + namespace net { class NetLog; class NetworkDelegate; @@ -46,7 +49,7 @@ class ProxyServiceFactory { net::URLRequestContext* context, net::NetworkDelegate* network_delegate, net::ProxyConfigService* proxy_config_service, - const CommandLine& command_line, + const base::CommandLine& command_line, bool quick_check_enabled); private: diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h index e86be50..c55d233 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h @@ -9,7 +9,9 @@ #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" +namespace base { class CommandLine; +} namespace notifier { @@ -26,7 +28,7 @@ class ChromeNotifierServiceFactory : public BrowserContextKeyedServiceFactory { // not. // TODO(petewil): Remove this when the SyncedNotifications feature is ready // to be turned on by default, and just use a disable switch instead then. - static bool UseSyncedNotifications(CommandLine* command_line); + static bool UseSyncedNotifications(base::CommandLine* command_line); private: friend struct DefaultSingletonTraits<ChromeNotifierServiceFactory>; diff --git a/chrome/browser/prefs/command_line_pref_store.h b/chrome/browser/prefs/command_line_pref_store.h index 066d005..eb4b94f 100644 --- a/chrome/browser/prefs/command_line_pref_store.h +++ b/chrome/browser/prefs/command_line_pref_store.h @@ -14,7 +14,7 @@ // such as proxy settings. class CommandLinePrefStore : public ValueMapPrefStore { public: - explicit CommandLinePrefStore(const CommandLine* command_line); + explicit CommandLinePrefStore(const base::CommandLine* command_line); protected: virtual ~CommandLinePrefStore(); @@ -58,7 +58,7 @@ class CommandLinePrefStore : public ValueMapPrefStore { void ApplyBackgroundModeSwitches(); // Weak reference. - const CommandLine* command_line_; + const base::CommandLine* command_line_; // Mappings of command line switches to prefs. static const BooleanSwitchToPreferenceMapEntry boolean_switch_map_[]; diff --git a/chrome/browser/prefs/incognito_mode_prefs.h b/chrome/browser/prefs/incognito_mode_prefs.h index 698250f..d7d8d29 100644 --- a/chrome/browser/prefs/incognito_mode_prefs.h +++ b/chrome/browser/prefs/incognito_mode_prefs.h @@ -7,10 +7,13 @@ #include "base/basictypes.h" -class CommandLine; class PrefService; class Profile; +namespace base { +class CommandLine; +} + namespace user_prefs { class PrefRegistrySyncable; } @@ -52,7 +55,7 @@ class IncognitoModePrefs { static bool IntToAvailability(int in_value, Availability* out_value); // Returns true if the browser should start in incognito mode. - static bool ShouldLaunchIncognito(const CommandLine& command_line, + static bool ShouldLaunchIncognito(const base::CommandLine& command_line, const PrefService* prefs); // Returns true if |profile| can open a new Browser. This checks the incognito diff --git a/chrome/browser/prefs/pref_service_syncable_factory.h b/chrome/browser/prefs/pref_service_syncable_factory.h index 715244e..b3d326c 100644 --- a/chrome/browser/prefs/pref_service_syncable_factory.h +++ b/chrome/browser/prefs/pref_service_syncable_factory.h @@ -7,9 +7,12 @@ #include "base/prefs/pref_service_factory.h" -class CommandLine; class PrefServiceSyncable; +namespace base { +class CommandLine; +} + namespace policy { class PolicyService; } @@ -33,7 +36,7 @@ class PrefServiceSyncableFactory : public base::PrefServiceFactory { #endif // Specifies to use an actual command-line backed command-line pref store. - void SetCommandLine(CommandLine* command_line); + void SetCommandLine(base::CommandLine* command_line); scoped_ptr<PrefServiceSyncable> CreateSyncable( user_prefs::PrefRegistrySyncable* registry); diff --git a/chrome/browser/prerender/prerender_field_trial.h b/chrome/browser/prerender/prerender_field_trial.h index 93760ee..9e1c764 100644 --- a/chrome/browser/prerender/prerender_field_trial.h +++ b/chrome/browser/prerender/prerender_field_trial.h @@ -7,15 +7,18 @@ #include <string> -class CommandLine; class Profile; +namespace base { +class CommandLine; +} + namespace prerender { // Parse the --prerender= command line switch, which controls prerendering. If // the switch is unset or is set to "auto" then the user is assigned to a // field trial. -void ConfigurePrerender(const CommandLine& command_line); +void ConfigurePrerender(const base::CommandLine& command_line); // Returns true if the user has opted in or has been opted in to the // prerendering from Omnibox experiment. diff --git a/chrome/browser/printing/print_dialog_cloud.h b/chrome/browser/printing/print_dialog_cloud.h index 9507903..47da7c8 100644 --- a/chrome/browser/printing/print_dialog_cloud.h +++ b/chrome/browser/printing/print_dialog_cloud.h @@ -14,10 +14,10 @@ #include "ui/gfx/native_widget_types.h" class Browser; -class CommandLine; class Profile; namespace base { +class CommandLine; class FilePath; } @@ -59,7 +59,7 @@ void CreatePrintDialogForBytes(content::BrowserContext* browser_context, // Parse switches from command_line and display the print dialog as appropriate. bool CreatePrintDialogFromCommandLine(Profile* profile, - const CommandLine& command_line); + const base::CommandLine& command_line); // Creates a tab with Google sinnin page. // Calls |callback| when complete. diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h index f0e6b72..8fc9730 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h @@ -32,7 +32,9 @@ #include "base/win/message_window.h" #endif // defined(OS_WIN) +namespace base { class CommandLine; +} // ProcessSingleton ---------------------------------------------------------- // @@ -60,7 +62,7 @@ class ProcessSingleton : public base::NonThreadSafe { // handled within the current browser instance or false if the remote process // should handle it (i.e., because the current process is shutting down). typedef base::Callback<bool( - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& current_directory)> NotificationCallback; ProcessSingleton(const base::FilePath& user_data_dir, @@ -101,11 +103,12 @@ class ProcessSingleton : public base::NonThreadSafe { #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) // Exposed for testing. We use a timeout on Linux, and in tests we want // this timeout to be short. - NotifyResult NotifyOtherProcessWithTimeout(const CommandLine& command_line, - int timeout_seconds, - bool kill_unresponsive); + NotifyResult NotifyOtherProcessWithTimeout( + const base::CommandLine& command_line, + int timeout_seconds, + bool kill_unresponsive); NotifyResult NotifyOtherProcessWithTimeoutOrCreate( - const CommandLine& command_line, + const base::CommandLine& command_line, int timeout_seconds); void OverrideCurrentPidForTesting(base::ProcessId pid); void OverrideKillCallbackForTesting( diff --git a/chrome/browser/process_singleton_modal_dialog_lock.h b/chrome/browser/process_singleton_modal_dialog_lock.h index d287865..73b7e7c1 100644 --- a/chrome/browser/process_singleton_modal_dialog_lock.h +++ b/chrome/browser/process_singleton_modal_dialog_lock.h @@ -10,9 +10,8 @@ #include "chrome/browser/process_singleton.h" #include "ui/gfx/native_widget_types.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -51,7 +50,7 @@ class ProcessSingletonModalDialogLock { ProcessSingleton::NotificationCallback AsNotificationCallback(); private: - bool NotificationCallbackImpl(const CommandLine& command_line, + bool NotificationCallbackImpl(const base::CommandLine& command_line, const base::FilePath& current_directory); gfx::NativeWindow active_dialog_; diff --git a/chrome/browser/process_singleton_startup_lock.h b/chrome/browser/process_singleton_startup_lock.h index 26c00bc..187dd35 100644 --- a/chrome/browser/process_singleton_startup_lock.h +++ b/chrome/browser/process_singleton_startup_lock.h @@ -41,10 +41,10 @@ class ProcessSingletonStartupLock : public base::NonThreadSafe { bool locked() { return locked_; } private: - typedef std::pair<CommandLine::StringVector, base::FilePath> + typedef std::pair<base::CommandLine::StringVector, base::FilePath> DelayedStartupMessage; - bool NotificationCallbackImpl(const CommandLine& command_line, + bool NotificationCallbackImpl(const base::CommandLine& command_line, const base::FilePath& current_directory); bool locked_; diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h index cae65ea..b9e49ce 100644 --- a/chrome/browser/profiles/profile_manager.h +++ b/chrome/browser/profiles/profile_manager.h @@ -24,7 +24,6 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -class CommandLine; class NewProfileLauncher; class ProfileInfoCache; diff --git a/chrome/browser/profiles/profile_shortcut_manager.h b/chrome/browser/profiles/profile_shortcut_manager.h index 6638f43..68cc324 100644 --- a/chrome/browser/profiles/profile_shortcut_manager.h +++ b/chrome/browser/profiles/profile_shortcut_manager.h @@ -10,9 +10,12 @@ #include "base/strings/string16.h" #include "chrome/browser/profiles/profile_info_cache.h" -class CommandLine; class ProfileManager; +namespace base { +class CommandLine; +} + class ProfileShortcutManager { public: virtual ~ProfileShortcutManager(); @@ -40,7 +43,7 @@ class ProfileShortcutManager { // Populates the |command_line|, |name| and |icon_path| that a shortcut for // the given |profile_path| should use. virtual void GetShortcutProperties(const base::FilePath& profile_path, - CommandLine* command_line, + base::CommandLine* command_line, base::string16* name, base::FilePath* icon_path) = 0; diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.h b/chrome/browser/profiles/profile_shortcut_manager_win.h index a2bb5d8..215178c 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_win.h +++ b/chrome/browser/profiles/profile_shortcut_manager_win.h @@ -63,7 +63,7 @@ class ProfileShortcutManagerWin : public ProfileShortcutManager, const base::FilePath& profile_path, const base::Callback<void(bool)>& callback) OVERRIDE; virtual void GetShortcutProperties(const base::FilePath& profile_path, - CommandLine* command_line, + base::CommandLine* command_line, base::string16* name, base::FilePath* icon_path) OVERRIDE; diff --git a/chrome/browser/service_process/service_process_control.h b/chrome/browser/service_process/service_process_control.h index 2e33145..eedd4a3 100644 --- a/chrome/browser/service_process/service_process_control.h +++ b/chrome/browser/service_process/service_process_control.h @@ -23,7 +23,9 @@ #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" +namespace base { class CommandLine; +} namespace cloud_print { struct CloudPrintProxyInfo; @@ -132,7 +134,7 @@ class ServiceProcessControl : public IPC::Sender, class Launcher : public base::RefCountedThreadSafe<ServiceProcessControl::Launcher> { public: - Launcher(ServiceProcessControl* process, CommandLine* cmd_line); + Launcher(ServiceProcessControl* process, base::CommandLine* cmd_line); // Execute the command line to start the process asynchronously. After the // command is executed |task| is called with the process handle on the UI // thread. @@ -152,7 +154,7 @@ class ServiceProcessControl : public IPC::Sender, void Notify(); void CloseProcessHandle(); ServiceProcessControl* process_; - scoped_ptr<CommandLine> cmd_line_; + scoped_ptr<base::CommandLine> cmd_line_; base::Closure notify_task_; bool launched_; uint32 retry_count_; diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h index 2926522..27cdc7c 100644 --- a/chrome/browser/shell_integration.h +++ b/chrome/browser/shell_integration.h @@ -14,7 +14,9 @@ #include "ui/gfx/image/image_family.h" #include "url/gurl.h" +namespace base { class CommandLine; +} class ShellIntegration { public: @@ -160,7 +162,7 @@ class ShellIntegration { // login profile, for ChromeOS). // If |extension_app_id| is non-empty, the arguments use kAppId=<id>. // Otherwise, kApp=<url> is used. - static CommandLine CommandLineArgsForLauncher( + static base::CommandLine CommandLineArgsForLauncher( const GURL& url, const std::string& extension_app_id, const base::FilePath& profile_path); @@ -170,7 +172,7 @@ class ShellIntegration { // The new command line reuses the current process's user data directory and // profile. static void AppendProfileArgs(const base::FilePath& profile_path, - CommandLine* command_line); + base::CommandLine* command_line); #if defined(OS_WIN) // Generates an application user model ID (AppUserModelId) for a given app diff --git a/chrome/browser/shell_integration_linux.h b/chrome/browser/shell_integration_linux.h index 88dfc34..44f0b7c 100644 --- a/chrome/browser/shell_integration_linux.h +++ b/chrome/browser/shell_integration_linux.h @@ -13,6 +13,7 @@ #include "url/gurl.h" namespace base { +class CommandLine; class Environment; } @@ -97,12 +98,13 @@ std::string GetDesktopFileContents(const base::FilePath& chrome_exe_path, // Returns contents for .desktop file that executes command_line. This is a more // general form of GetDesktopFileContents. If |no_display| is true, the shortcut // will not be visible to the user in menus. -std::string GetDesktopFileContentsForCommand(const CommandLine& command_line, - const std::string& app_name, - const GURL& url, - const base::string16& title, - const std::string& icon_name, - bool no_display); +std::string GetDesktopFileContentsForCommand( + const base::CommandLine& command_line, + const std::string& app_name, + const GURL& url, + const base::string16& title, + const std::string& icon_name, + bool no_display); // Returns contents for .directory file named |title| with icon |icon_name|. If // |icon_name| is empty, will use the Chrome icon. diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.h b/chrome/browser/sync/profile_sync_components_factory_impl.h index ee9d9f5..ec41352 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.h +++ b/chrome/browser/sync/profile_sync_components_factory_impl.h @@ -12,9 +12,11 @@ #include "chrome/browser/sync/profile_sync_components_factory.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" +class Profile; +namespace base { class CommandLine; -class Profile; +} namespace extensions { class ExtensionSystem; @@ -23,7 +25,7 @@ class ExtensionSystem; class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory { public: ProfileSyncComponentsFactoryImpl(Profile* profile, - CommandLine* command_line); + base::CommandLine* command_line); virtual ~ProfileSyncComponentsFactoryImpl(); virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE; @@ -74,7 +76,7 @@ class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory { void RegisterCommonDataTypes(ProfileSyncService* pss); Profile* profile_; - CommandLine* command_line_; + base::CommandLine* command_line_; // Set on the UI thread (since extensions::ExtensionSystemFactory is // non-threadsafe); accessed on both the UI and FILE threads in // GetSyncableServiceForType. diff --git a/chrome/browser/sync/test/integration/migration_test.cc b/chrome/browser/sync/test/integration/migration_test.cc index 07ff3de..58ca300 100644 --- a/chrome/browser/sync/test/integration/migration_test.cc +++ b/chrome/browser/sync/test/integration/migration_test.cc @@ -515,7 +515,7 @@ class MigrationReconfigureTest : public MigrationTwoClientTest { public: MigrationReconfigureTest() {} - virtual void SetUpCommandLine(CommandLine* cl) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* cl) OVERRIDE { AddTestSwitches(cl); // Do not add optional datatypes. } diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 8e381ae..3c9ca3a 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -137,7 +137,7 @@ SyncTest::SyncTest(TestType test_type) SyncTest::~SyncTest() {} void SyncTest::SetUp() { - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); if (cl->HasSwitch(switches::kPasswordFileForTest)) { ReadPasswordFile(); } else if (cl->HasSwitch(switches::kSyncUserForTest) && @@ -210,12 +210,12 @@ void SyncTest::TearDown() { TearDownLocalTestServer(); } -void SyncTest::SetUpCommandLine(CommandLine* cl) { +void SyncTest::SetUpCommandLine(base::CommandLine* cl) { AddTestSwitches(cl); AddOptionalTypesToCommandLine(cl); } -void SyncTest::AddTestSwitches(CommandLine* cl) { +void SyncTest::AddTestSwitches(base::CommandLine* cl) { // Disable non-essential access of external network resources. if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) cl->AppendSwitch(switches::kDisableBackgroundNetworking); @@ -229,7 +229,7 @@ void SyncTest::AddTestSwitches(CommandLine* cl) { cl->AppendSwitch(switches::kDisableSyncPriorityPreferences); } -void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) {} +void SyncTest::AddOptionalTypesToCommandLine(base::CommandLine* cl) {} // static Profile* SyncTest::MakeProfile(const base::FilePath::StringType name) { @@ -414,7 +414,7 @@ void SyncTest::TearDownInProcessBrowserTestFixture() { } void SyncTest::ReadPasswordFile() { - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); password_file_ = cl->GetSwitchValuePath(switches::kPasswordFileForTest); if (password_file_.empty()) LOG(FATAL) << "Can't run live server test without specifying --" @@ -535,7 +535,7 @@ bool SyncTest::SetUpLocalPythonTestServer() { EXPECT_TRUE(sync_server_.Start()) << "Could not launch local python test server."; - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); if (server_type_ == LOCAL_PYTHON_SERVER) { std::string sync_service_url = sync_server_.GetURL("chromiumsync").spec(); cl->AppendSwitchASCII(switches::kSyncServiceURL, sync_service_url); @@ -569,13 +569,13 @@ bool SyncTest::SetUpLocalPythonTestServer() { } bool SyncTest::SetUpLocalTestServer() { - CommandLine* cl = CommandLine::ForCurrentProcess(); - CommandLine::StringType server_cmdline_string = cl->GetSwitchValueNative( - switches::kSyncServerCommandLine); - CommandLine::StringVector server_cmdline_vector; - CommandLine::StringType delimiters(FILE_PATH_LITERAL(" ")); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringType server_cmdline_string = + cl->GetSwitchValueNative(switches::kSyncServerCommandLine); + base::CommandLine::StringVector server_cmdline_vector; + base::CommandLine::StringType delimiters(FILE_PATH_LITERAL(" ")); Tokenize(server_cmdline_string, delimiters, &server_cmdline_vector); - CommandLine server_cmdline(server_cmdline_vector); + base::CommandLine server_cmdline(server_cmdline_vector); base::LaunchOptions options; #if defined(OS_WIN) options.start_hidden = true; @@ -625,7 +625,7 @@ bool SyncTest::WaitForTestServerToStart(base::TimeDelta wait, int intervals) { } bool SyncTest::IsTestServerRunning() { - CommandLine* cl = CommandLine::ForCurrentProcess(); + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); GURL sync_url_status(sync_url.append("/healthz")); SyncServerStatusChecker delegate; diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index 6313c25..3e7d12b 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h @@ -21,11 +21,13 @@ #include "sync/test/fake_server/fake_server.h" #include "sync/test/local_sync_test_server.h" - -class CommandLine; class Profile; class ProfileSyncServiceHarness; +namespace base { +class CommandLine; +} + namespace net { class FakeURLFetcherFactory; class ProxyConfig; @@ -120,7 +122,7 @@ class SyncTest : public InProcessBrowserTest { virtual void TearDown() OVERRIDE; // Sets up command line flags required for sync tests. - virtual void SetUpCommandLine(CommandLine* cl) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* cl) OVERRIDE; // Used to get the number of sync clients used by a test. int num_clients() WARN_UNUSED_RESULT { return num_clients_; } @@ -237,11 +239,11 @@ class SyncTest : public InProcessBrowserTest { protected: // Add custom switches needed for running the test. - virtual void AddTestSwitches(CommandLine* cl); + virtual void AddTestSwitches(base::CommandLine* cl); // Append the command line switches to enable experimental types that aren't // on by default yet. - virtual void AddOptionalTypesToCommandLine(CommandLine* cl); + virtual void AddOptionalTypesToCommandLine(base::CommandLine* cl); // InProcessBrowserTest override. Destroys all the sync clients and sync // profiles created by a test. diff --git a/chrome/browser/ui/app_list/app_list_service.h b/chrome/browser/ui/app_list/app_list_service.h index 4ee6604..91fbe7f 100644 --- a/chrome/browser/ui/app_list/app_list_service.h +++ b/chrome/browser/ui/app_list/app_list_service.h @@ -13,11 +13,11 @@ #include "ui/gfx/native_widget_types.h" class AppListControllerDelegate; -class CommandLine; class PrefRegistrySimple; class Profile; namespace base { +class CommandLine; class FilePath; } @@ -51,7 +51,7 @@ class AppListService { static void RegisterPrefs(PrefRegistrySimple* registry); - static void RecordShowTimings(const CommandLine& command_line); + static void RecordShowTimings(const base::CommandLine& command_line); // Indicates that |callback| should be called next time the app list is // painted. diff --git a/chrome/browser/ui/app_list/app_list_service_disabled.cc b/chrome/browser/ui/app_list/app_list_service_disabled.cc index 484358d..4e7b5d1 100644 --- a/chrome/browser/ui/app_list/app_list_service_disabled.cc +++ b/chrome/browser/ui/app_list/app_list_service_disabled.cc @@ -66,4 +66,4 @@ void AppListService::InitAll(Profile* initial_profile) {} void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {} // static -void AppListService::RecordShowTimings(const CommandLine& command_line) {} +void AppListService::RecordShowTimings(const base::CommandLine& command_line) {} diff --git a/chrome/browser/ui/app_list/app_list_service_impl.h b/chrome/browser/ui/app_list/app_list_service_impl.h index 213da34..55660cd 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.h +++ b/chrome/browser/ui/app_list/app_list_service_impl.h @@ -31,7 +31,7 @@ class AppListServiceImpl : public AppListService, virtual ~AppListServiceImpl(); // Constructor used for testing. - AppListServiceImpl(const CommandLine& command_line, + AppListServiceImpl(const base::CommandLine& command_line, PrefService* local_state, scoped_ptr<ProfileStore> profile_store, scoped_ptr<KeepAliveService> keep_alive_service); @@ -83,7 +83,7 @@ class AppListServiceImpl : public AppListService, scoped_ptr<ProfileStore> profile_store_; base::WeakPtrFactory<AppListServiceImpl> weak_factory_; - CommandLine command_line_; + base::CommandLine command_line_; PrefService* local_state_; scoped_ptr<ProfileLoader> profile_loader_; diff --git a/chrome/browser/ui/extensions/application_launch.h b/chrome/browser/ui/extensions/application_launch.h index 280d549..e18211a 100644 --- a/chrome/browser/ui/extensions/application_launch.h +++ b/chrome/browser/ui/extensions/application_launch.h @@ -14,9 +14,12 @@ #include "url/gurl.h" class Browser; -class CommandLine; class Profile; +namespace base { +class CommandLine; +} + namespace content { class WebContents; } @@ -72,7 +75,7 @@ struct AppLaunchParams { // If non-empty, information from the command line may be passed on to the // application. - CommandLine command_line; + base::CommandLine command_line; // If non-empty, the current directory from which any relative paths on the // command line should be expanded from. diff --git a/chrome/browser/ui/libgtk2ui/gtk2_util.h b/chrome/browser/ui/libgtk2ui/gtk2_util.h index d58038d..20daa6e 100644 --- a/chrome/browser/ui/libgtk2ui/gtk2_util.h +++ b/chrome/browser/ui/libgtk2ui/gtk2_util.h @@ -8,10 +8,10 @@ #include <gtk/gtk.h> #include <string> -class CommandLine; class SkBitmap; namespace base { +class CommandLine; class Environment; } @@ -21,7 +21,7 @@ class Accelerator; namespace libgtk2ui { -void GtkInitFromCommandLine(const CommandLine& command_line); +void GtkInitFromCommandLine(const base::CommandLine& command_line); // Returns the name of the ".desktop" file associated with our running process. std::string GetDesktopName(base::Environment* env); diff --git a/chrome/browser/ui/panels/base_panel_browser_test.h b/chrome/browser/ui/panels/base_panel_browser_test.h index bd5a10d4..abe638f 100644 --- a/chrome/browser/ui/panels/base_panel_browser_test.h +++ b/chrome/browser/ui/panels/base_panel_browser_test.h @@ -55,7 +55,7 @@ class BasePanelBrowserTest : public InProcessBrowserTest { // tests to ensure we still have coverage on the bots. bool SkipTestIfCompizWM(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; protected: diff --git a/chrome/browser/ui/startup/startup_browser_creator.h b/chrome/browser/ui/startup/startup_browser_creator.h index 8496d2b..9cef54f 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.h +++ b/chrome/browser/ui/startup/startup_browser_creator.h @@ -18,10 +18,13 @@ #include "url/gurl.h" class Browser; -class CommandLine; class GURL; class PrefService; +namespace base { +class CommandLine; +} + // class containing helpers for BrowserMain to spin up a new instance and // initialize the profile. class StartupBrowserCreator { @@ -37,7 +40,7 @@ class StartupBrowserCreator { // This function is equivalent to ProcessCommandLine but should only be // called during actual process startup. - bool Start(const CommandLine& cmd_line, + bool Start(const base::CommandLine& cmd_line, const base::FilePath& cur_dir, Profile* last_used_profile, const Profiles& last_opened_profiles, @@ -54,7 +57,7 @@ class StartupBrowserCreator { // |startup_profile_dir| is the directory that contains the profile that the // command line arguments will be executed under. static void ProcessCommandLineAlreadyRunning( - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& cur_dir, const base::FilePath& startup_profile_dir); @@ -72,7 +75,7 @@ class StartupBrowserCreator { // implies that the directory of the executable should be used. // |process_startup| indicates whether this is the first browser. // |is_first_run| indicates that this is a new profile. - bool LaunchBrowser(const CommandLine& command_line, + bool LaunchBrowser(const base::CommandLine& command_line, Profile* profile, const base::FilePath& cur_dir, chrome::startup::IsProcessStartup is_process_startup, @@ -85,7 +88,7 @@ class StartupBrowserCreator { static bool WasRestarted(); static SessionStartupPref GetSessionStartupPref( - const CommandLine& command_line, + const base::CommandLine& command_line, Profile* profile); void set_is_default_browser_dialog_suppressed(bool new_value) { @@ -121,11 +124,11 @@ class StartupBrowserCreator { // Returns the list of URLs to open from the command line. The returned // vector is empty if the user didn't specify any URLs on the command line. static std::vector<GURL> GetURLsFromCommandLine( - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& cur_dir, Profile* profile); - static bool ProcessCmdLineImpl(const CommandLine& command_line, + static bool ProcessCmdLineImpl(const base::CommandLine& command_line, const base::FilePath& cur_dir, bool process_startup, Profile* last_used_profile, @@ -135,7 +138,7 @@ class StartupBrowserCreator { // Callback after a profile has been created. static void ProcessCommandLineOnProfileCreated( - const CommandLine& command_line, + const base::CommandLine& command_line, const base::FilePath& cur_dir, Profile* profile, Profile::CreateStatus status); @@ -173,6 +176,6 @@ bool HasPendingUncleanExit(Profile* profile); // Returns the path that contains the profile that should be loaded on process // startup. base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, - const CommandLine& command_line); + const base::CommandLine& command_line); #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.h b/chrome/browser/ui/startup/startup_browser_creator_impl.h index a5ae4585..b50c9c7 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.h +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.h @@ -16,11 +16,11 @@ #include "url/gurl.h" class Browser; -class CommandLine; class Profile; class StartupBrowserCreator; namespace base { +class CommandLine; class FilePath; } @@ -45,10 +45,10 @@ class StartupBrowserCreatorImpl { // second one is always called when the browser starts even if it is not // the first run. |is_first_run| indicates that this is a new profile. StartupBrowserCreatorImpl(const base::FilePath& cur_dir, - const CommandLine& command_line, + const base::CommandLine& command_line, chrome::startup::IsFirstRun is_first_run); StartupBrowserCreatorImpl(const base::FilePath& cur_dir, - const CommandLine& command_line, + const base::CommandLine& command_line, StartupBrowserCreator* browser_creator, chrome::startup::IsFirstRun is_first_run); ~StartupBrowserCreatorImpl(); @@ -159,7 +159,7 @@ class StartupBrowserCreatorImpl { const std::vector<GURL>& startup_urls); const base::FilePath cur_dir_; - const CommandLine& command_line_; + const base::CommandLine& command_line_; Profile* profile_; StartupBrowserCreator* browser_creator_; bool is_first_run_; diff --git a/chrome/browser/ui/webui/bidi_checker_web_ui_test.h b/chrome/browser/ui/webui/bidi_checker_web_ui_test.h index 02c38b9..0082e10 100644 --- a/chrome/browser/ui/webui/bidi_checker_web_ui_test.h +++ b/chrome/browser/ui/webui/bidi_checker_web_ui_test.h @@ -34,7 +34,7 @@ class WebUIBidiCheckerBrowserTest : public WebUIBrowserTest { private: // The command line args used to run the test before being changed in SetUp(). - CommandLine::StringVector argv_; + base::CommandLine::StringVector argv_; }; // Base class for BidiChecker-based tests that run with an LTR UI. diff --git a/chrome/browser/ui/webui/downloads_ui_browsertest.h b/chrome/browser/ui/webui/downloads_ui_browsertest.h index d38ee1e..6272e87 100644 --- a/chrome/browser/ui/webui/downloads_ui_browsertest.h +++ b/chrome/browser/ui/webui/downloads_ui_browsertest.h @@ -24,7 +24,7 @@ class DownloadsUIBrowserTest : public WebUIBrowserTest { class DownloadsWebUIForSupervisedUsersTest : public DownloadsUIBrowserTest { public: // InProcessBrowserTest overrides: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; #endif // CHROME_BROWSER_UI_WEBUI_DOWNLOADS_UI_BROWSERTEST_H_ diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h index 17830d1..252a22c 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h @@ -23,7 +23,7 @@ class NetInternalsTest : public WebUIBrowserTest { class MessageHandler; // InProcessBrowserTest overrides. - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; // WebUIBrowserTest implementation. diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h index 99a581c..dd378fb 100644 --- a/chrome/common/crash_keys.h +++ b/chrome/common/crash_keys.h @@ -11,7 +11,9 @@ #include "base/debug/crash_logging.h" +namespace base { class CommandLine; +} namespace crash_keys { @@ -23,7 +25,7 @@ size_t RegisterChromeCrashKeys(); void SetClientID(const std::string& client_id); // Sets the kSwitch and kNumSwitches keys based on the given |command_line|. -void SetSwitchesFromCommandLine(const CommandLine* command_line); +void SetSwitchesFromCommandLine(const base::CommandLine* command_line); // Sets the list of active experiment/variations info. void SetVariationsList(const std::vector<std::string>& variations); diff --git a/chrome/common/logging_chrome.h b/chrome/common/logging_chrome.h index 91cd276..5fb8724 100644 --- a/chrome/common/logging_chrome.h +++ b/chrome/common/logging_chrome.h @@ -11,9 +11,8 @@ #include "base/logging.h" #include "base/time/time.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -32,15 +31,15 @@ namespace logging { // normally appear for assertions and crashes, and makes any catchable // errors (namely assertions) available via GetSilencedErrorCount() // and GetSilencedError(). -void InitChromeLogging(const CommandLine& command_line, +void InitChromeLogging(const base::CommandLine& command_line, OldFileDeletionState delete_old_log_file); #if defined(OS_CHROMEOS) // Get the log file location. -base::FilePath GetSessionLogFile(const CommandLine& command_line); +base::FilePath GetSessionLogFile(const base::CommandLine& command_line); // Redirects chrome logging to the appropriate session log dir. -void RedirectChromeLogging(const CommandLine& command_line); +void RedirectChromeLogging(const base::CommandLine& command_line); #endif // Call when done using logging for Chrome. diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h index a85f4df..fb18a47 100644 --- a/chrome/common/service_process_util.h +++ b/chrome/common/service_process_util.h @@ -14,7 +14,6 @@ #include "base/process/process.h" #include "ipc/ipc_channel_handle.h" -class CommandLine; class MultiProcessLock; #if defined(OS_MACOSX) @@ -26,6 +25,7 @@ class NSString; #endif namespace base { +class CommandLine; class MessageLoopProxy; } @@ -138,7 +138,7 @@ class ServiceProcessState { struct StateData; StateData* state_; scoped_ptr<base::SharedMemory> shared_mem_service_data_; - scoped_ptr<CommandLine> autorun_command_line_; + scoped_ptr<base::CommandLine> autorun_command_line_; }; #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ diff --git a/chrome/common/service_process_util_posix.h b/chrome/common/service_process_util_posix.h index 2e03e46..c1d02b9 100644 --- a/chrome/common/service_process_util_posix.h +++ b/chrome/common/service_process_util_posix.h @@ -23,8 +23,11 @@ MultiProcessLock* TakeServiceRunningLock(bool waiting); #include "base/files/file_path_watcher.h" #include "base/mac/scoped_cftyperef.h" +namespace base { class CommandLine; -CFDictionaryRef CreateServiceProcessLaunchdPlist(CommandLine* cmd_line, +} + +CFDictionaryRef CreateServiceProcessLaunchdPlist(base::CommandLine* cmd_line, bool for_auto_launch); #endif // OS_MACOSX diff --git a/chrome/common/switch_utils.h b/chrome/common/switch_utils.h index 83594d1..df91b2d5 100644 --- a/chrome/common/switch_utils.h +++ b/chrome/common/switch_utils.h @@ -14,7 +14,7 @@ namespace switches { // Remove the keys that we shouldn't pass through during restart. void RemoveSwitchesForAutostart( - std::map<std::string, CommandLine::StringType>* switches); + std::map<std::string, base::CommandLine::StringType>* switches); } // namespace switches diff --git a/chrome/installer/setup/install_worker.h b/chrome/installer/setup/install_worker.h index abcd1e5..41d1b04 100644 --- a/chrome/installer/setup/install_worker.h +++ b/chrome/installer/setup/install_worker.h @@ -13,10 +13,10 @@ #include <vector> class BrowserDistribution; -class CommandLine; class WorkItemList; namespace base { +class CommandLine; class FilePath; class Version; } @@ -161,7 +161,7 @@ void AddDeleteOldIELowRightsPolicyWorkItems( // Utility method currently shared between install.cc and install_worker.cc void AppendUninstallCommandLineFlags(const InstallerState& installer_state, const Product& product, - CommandLine* uninstall_cmd); + base::CommandLine* uninstall_cmd); // Refreshes the elevation policy on platforms where it is supported. void RefreshElevationPolicy(); diff --git a/chrome/installer/setup/setup_main.h b/chrome/installer/setup/setup_main.h index 45f92d84..5bcf457 100644 --- a/chrome/installer/setup/setup_main.h +++ b/chrome/installer/setup/setup_main.h @@ -10,9 +10,8 @@ #include "chrome/installer/util/util_constants.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } // namespace base @@ -28,7 +27,7 @@ class MasterPreferences; // |true| if installation was delegated to a pre-existing higher version. InstallStatus InstallProductsHelper(const InstallationState& original_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line, + const base::CommandLine& cmd_line, const MasterPreferences& prefs, const InstallerState& installer_state, base::FilePath* installer_directory, diff --git a/chrome/installer/setup/setup_util.h b/chrome/installer/setup/setup_util.h index 897bf67..1d91cb8 100644 --- a/chrome/installer/setup/setup_util.h +++ b/chrome/installer/setup/setup_util.h @@ -17,9 +17,8 @@ #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/util_constants.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; class Version; } @@ -79,7 +78,7 @@ bool GetExistingHigherInstaller(const InstallationState& original_state, // invoked |setup_exe| runs the newly installed product prior to exiting. // Returns true if |setup_exe| was launched, false otherwise. bool DeferToExistingInstall(const base::FilePath& setup_exe, - const CommandLine& command_line, + const base::CommandLine& command_line, const InstallerState& installer_state, const base::FilePath& temp_path, InstallStatus* install_status); @@ -111,7 +110,7 @@ void MigrateGoogleUpdateStateMultiToSingle( bool IsUninstallSuccess(InstallStatus install_status); // Returns true if |cmd_line| contains unsupported (legacy) switches. -bool ContainsUnsupportedSwitch(const CommandLine& cmd_line); +bool ContainsUnsupportedSwitch(const base::CommandLine& cmd_line); // Returns true if the processor is supported by chrome. bool IsProcessorSupported(); diff --git a/chrome/installer/setup/uninstall.h b/chrome/installer/setup/uninstall.h index 96c3411..2c9151c 100644 --- a/chrome/installer/setup/uninstall.h +++ b/chrome/installer/setup/uninstall.h @@ -13,9 +13,9 @@ #include "chrome/installer/util/util_constants.h" class BrowserDistribution; -class CommandLine; namespace base { +class CommandLine; class FilePath; } @@ -76,7 +76,7 @@ installer::InstallStatus UninstallProduct( const Product& dist, bool remove_all, bool force_uninstall, - const CommandLine& cmd_line); + const base::CommandLine& cmd_line); // Cleans up the installation directory after all uninstall operations have // completed. Depending on what products are remaining, setup.exe and the diff --git a/chrome/installer/util/chrome_app_host_operations.h b/chrome/installer/util/chrome_app_host_operations.h index cb954a5..bbd75ba 100644 --- a/chrome/installer/util/chrome_app_host_operations.h +++ b/chrome/installer/util/chrome_app_host_operations.h @@ -20,7 +20,7 @@ class ChromeAppHostOperations : public ProductOperations { virtual void ReadOptions(const MasterPreferences& prefs, std::set<base::string16>* options) const OVERRIDE; - virtual void ReadOptions(const CommandLine& uninstall_command, + virtual void ReadOptions(const base::CommandLine& uninstall_command, std::set<base::string16>* options) const OVERRIDE; virtual void AddKeyFiles( @@ -32,10 +32,10 @@ class ChromeAppHostOperations : public ProductOperations { std::vector<base::FilePath>* com_dll_list) const OVERRIDE; virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual bool SetChannelFlags(const std::set<base::string16>& options, bool set, diff --git a/chrome/installer/util/chrome_binaries_operations.h b/chrome/installer/util/chrome_binaries_operations.h index d1015ed..929fa43 100644 --- a/chrome/installer/util/chrome_binaries_operations.h +++ b/chrome/installer/util/chrome_binaries_operations.h @@ -20,7 +20,7 @@ class ChromeBinariesOperations : public ProductOperations { virtual void ReadOptions(const MasterPreferences& prefs, std::set<base::string16>* options) const OVERRIDE; - virtual void ReadOptions(const CommandLine& uninstall_command, + virtual void ReadOptions(const base::CommandLine& uninstall_command, std::set<base::string16>* options) const OVERRIDE; virtual void AddKeyFiles( @@ -32,10 +32,10 @@ class ChromeBinariesOperations : public ProductOperations { std::vector<base::FilePath>* com_dll_list) const OVERRIDE; virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual bool SetChannelFlags(const std::set<base::string16>& options, bool set, diff --git a/chrome/installer/util/chrome_browser_operations.h b/chrome/installer/util/chrome_browser_operations.h index e0e6e4d..06bdb55 100644 --- a/chrome/installer/util/chrome_browser_operations.h +++ b/chrome/installer/util/chrome_browser_operations.h @@ -19,7 +19,7 @@ class ChromeBrowserOperations : public ProductOperations { virtual void ReadOptions(const MasterPreferences& prefs, std::set<base::string16>* options) const OVERRIDE; - virtual void ReadOptions(const CommandLine& uninstall_command, + virtual void ReadOptions(const base::CommandLine& uninstall_command, std::set<base::string16>* options) const OVERRIDE; virtual void AddKeyFiles( @@ -31,10 +31,10 @@ class ChromeBrowserOperations : public ProductOperations { std::vector<base::FilePath>* com_dll_list) const OVERRIDE; virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual bool SetChannelFlags(const std::set<base::string16>& options, bool set, diff --git a/chrome/installer/util/chrome_browser_sxs_operations.h b/chrome/installer/util/chrome_browser_sxs_operations.h index 5c82a3c..6a189d1a 100644 --- a/chrome/installer/util/chrome_browser_sxs_operations.h +++ b/chrome/installer/util/chrome_browser_sxs_operations.h @@ -17,10 +17,10 @@ class ChromeBrowserSxSOperations : public ChromeBrowserOperations { ChromeBrowserSxSOperations() {} virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ChromeBrowserSxSOperations); diff --git a/chrome/installer/util/chrome_frame_operations.h b/chrome/installer/util/chrome_frame_operations.h index fb35a07..497a151 100644 --- a/chrome/installer/util/chrome_frame_operations.h +++ b/chrome/installer/util/chrome_frame_operations.h @@ -19,7 +19,7 @@ class ChromeFrameOperations : public ProductOperations { virtual void ReadOptions(const MasterPreferences& prefs, std::set<base::string16>* options) const OVERRIDE; - virtual void ReadOptions(const CommandLine& uninstall_command, + virtual void ReadOptions(const base::CommandLine& uninstall_command, std::set<base::string16>* options) const OVERRIDE; virtual void AddKeyFiles( @@ -31,10 +31,10 @@ class ChromeFrameOperations : public ProductOperations { std::vector<base::FilePath>* com_dll_list) const OVERRIDE; virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const OVERRIDE; + base::CommandLine* cmd_line) const OVERRIDE; virtual bool SetChannelFlags(const std::set<base::string16>& options, bool set, diff --git a/chrome/installer/util/fake_product_state.h b/chrome/installer/util/fake_product_state.h index 27946b7..8b6e866 100644 --- a/chrome/installer/util/fake_product_state.h +++ b/chrome/installer/util/fake_product_state.h @@ -23,7 +23,7 @@ class FakeProductState : public ProductState { } void clear_usagestats() { has_usagestats_ = false; } void SetUninstallProgram(const base::FilePath& setup_exe) { - uninstall_command_ = CommandLine(setup_exe); + uninstall_command_ = base::CommandLine(setup_exe); } void AddUninstallSwitch(const std::string& option) { uninstall_command_.AppendSwitch(option); diff --git a/chrome/installer/util/install_util.h b/chrome/installer/util/install_util.h index 1ea0edd..5bc6b91 100644 --- a/chrome/installer/util/install_util.h +++ b/chrome/installer/util/install_util.h @@ -41,12 +41,12 @@ class InstallUtil { static void TriggerActiveSetupCommand(); // Launches given exe as admin on Vista. - static bool ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code); + static bool ExecuteExeAsAdmin(const base::CommandLine& cmd, DWORD* exit_code); // Reads the uninstall command for Chromium from registry and returns it. // If system_install is true the command is read from HKLM, otherwise // from HKCU. - static CommandLine GetChromeUninstallCmd( + static base::CommandLine GetChromeUninstallCmd( bool system_install, BrowserDistribution::Type distribution_type); @@ -173,7 +173,7 @@ class InstallUtil { // Composes |program| and |arguments| into |command_line|. static void MakeUninstallCommand(const base::string16& program, const base::string16& arguments, - CommandLine* command_line); + base::CommandLine* command_line); // Returns a string in the form YYYYMMDD of the current date. static base::string16 GetCurrentDate(); diff --git a/chrome/installer/util/installation_state.h b/chrome/installer/util/installation_state.h index 153760d2..28630cc 100644 --- a/chrome/installer/util/installation_state.h +++ b/chrome/installer/util/installation_state.h @@ -83,7 +83,9 @@ class ProductState { bool is_msi() const { return msi_; } // The command to uninstall the product; may be empty. - const CommandLine& uninstall_command() const { return uninstall_command_; } + const base::CommandLine& uninstall_command() const { + return uninstall_command_; + } // True if |uninstall_command| contains --multi-install. bool is_multi_install() const { return multi_install_; } @@ -107,7 +109,7 @@ class ProductState { std::wstring brand_; std::wstring rename_cmd_; std::wstring oem_install_; - CommandLine uninstall_command_; + base::CommandLine uninstall_command_; AppCommands commands_; DWORD eula_accepted_; DWORD usagestats_; diff --git a/chrome/installer/util/installation_validator.h b/chrome/installer/util/installation_validator.h index 3dcc583..46212f6 100644 --- a/chrome/installer/util/installation_validator.h +++ b/chrome/installer/util/installation_validator.h @@ -15,9 +15,8 @@ #include "base/strings/string16.h" #include "chrome/installer/util/browser_distribution.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -231,12 +230,12 @@ class InstallationValidator { const base::string16& purpose, bool* is_valid); static void ValidateCommandExpectations(const ProductContext& ctx, - const CommandLine& command, + const base::CommandLine& command, const SwitchExpectations& expected, const base::string16& source, bool* is_valid); static void ValidateUninstallCommand(const ProductContext& ctx, - const CommandLine& command, + const base::CommandLine& command, const base::string16& source, bool* is_valid); static void ValidateRenameCommand(const ProductContext& ctx, diff --git a/chrome/installer/util/installer_state.h b/chrome/installer/util/installer_state.h index fd65574..7b22cf6 100644 --- a/chrome/installer/util/installer_state.h +++ b/chrome/installer/util/installer_state.h @@ -23,7 +23,9 @@ #include <windows.h> // NOLINT #endif +namespace base { class CommandLine; +} namespace installer { @@ -73,7 +75,7 @@ class InstallerState { explicit InstallerState(Level level); // Initializes this object based on the current operation. - void Initialize(const CommandLine& command_line, + void Initialize(const base::CommandLine& command_line, const MasterPreferences& prefs, const InstallationState& machine_state); diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h index b068b46..83f1150 100644 --- a/chrome/installer/util/master_preferences.h +++ b/chrome/installer/util/master_preferences.h @@ -85,7 +85,7 @@ class MasterPreferences { // is present in the command line. // The options from the preference file and command line are merged, with the // ones from the command line taking precedence in case of a conflict. - explicit MasterPreferences(const CommandLine& cmd_line); + explicit MasterPreferences(const base::CommandLine& cmd_line); // Parses a specific preferences file and does not merge any command line // switches with the distribution dictionary. @@ -191,7 +191,7 @@ class MasterPreferences { static const MasterPreferences& ForCurrentProcess(); protected: - void InitializeFromCommandLine(const CommandLine& cmd_line); + void InitializeFromCommandLine(const base::CommandLine& cmd_line); // Initializes the instance from a given JSON string, returning true if the // string was successfully parsed. diff --git a/chrome/installer/util/product.h b/chrome/installer/util/product.h index 9ff763b..4e70b42 100644 --- a/chrome/installer/util/product.h +++ b/chrome/installer/util/product.h @@ -14,7 +14,9 @@ #include "chrome/installer/util/shell_util.h" #include "chrome/installer/util/util_constants.h" +namespace base { class CommandLine; +} namespace installer { @@ -40,7 +42,8 @@ class Product { void InitializeFromPreferences(const MasterPreferences& prefs); - void InitializeFromUninstallCommand(const CommandLine& uninstall_command); + void InitializeFromUninstallCommand( + const base::CommandLine& uninstall_command); BrowserDistribution* distribution() const { return distribution_; @@ -98,7 +101,7 @@ class Product { // NOTE: The 'options' CommandLine object should only contain parameters. // The program part will be ignored. bool LaunchChromeAndWait(const base::FilePath& application_path, - const CommandLine& options, + const base::CommandLine& options, int32* exit_code) const; // Sets the boolean MSI marker for this installation if set is true or clears @@ -117,10 +120,10 @@ class Product { void AddComDllList(std::vector<base::FilePath>* com_dll_list) const; // See ProductOperations::AppendProductFlags. - void AppendProductFlags(CommandLine* command_line) const; + void AppendProductFlags(base::CommandLine* command_line) const; // See ProductOperations::AppendRenameFlags. - void AppendRenameFlags(CommandLine* command_line) const; + void AppendRenameFlags(base::CommandLine* command_line) const; // See Productoperations::SetChannelFlags. bool SetChannelFlags(bool set, ChannelInfo* channel_info) const; diff --git a/chrome/installer/util/product_operations.h b/chrome/installer/util/product_operations.h index bb6c208..d84a1b9 100644 --- a/chrome/installer/util/product_operations.h +++ b/chrome/installer/util/product_operations.h @@ -15,7 +15,10 @@ #include "chrome/installer/util/util_constants.h" class BrowserDistribution; + +namespace base { class CommandLine; +} namespace installer { @@ -35,7 +38,7 @@ class ProductOperations { std::set<base::string16>* options) const = 0; // Reads product-specific options from |command|, adding them to |options|. - virtual void ReadOptions(const CommandLine& command, + virtual void ReadOptions(const base::CommandLine& command, std::set<base::string16>* options) const = 0; // A key-file is a file such as a DLL on Windows that is expected to be in use @@ -59,11 +62,11 @@ class ProductOperations { // required for product-specific uninstall commands, but are of use for any // invocation of setup.exe for the product. virtual void AppendProductFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const = 0; + base::CommandLine* cmd_line) const = 0; // Given a command line, appends the set of product-specific rename flags. virtual void AppendRenameFlags(const std::set<base::string16>& options, - CommandLine* cmd_line) const = 0; + base::CommandLine* cmd_line) const = 0; // Adds or removes product-specific flags in |channel_info|. Returns true if // |channel_info| is modified. diff --git a/chrome/installer/util/user_experiment.h b/chrome/installer/util/user_experiment.h index 98fce5f..7856f77 100644 --- a/chrome/installer/util/user_experiment.h +++ b/chrome/installer/util/user_experiment.h @@ -11,9 +11,8 @@ #include "base/strings/string16.h" #include "chrome/installer/util/util_constants.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -52,7 +51,7 @@ bool CreateExperimentDetails(int flavor, ExperimentDetails* experiment); // After an install or upgrade the user might qualify to participate in an // experiment. This function determines if the user qualifies and if so it // sets the wheels in motion or in simple cases does the experiment itself. -void LaunchBrowserUserExperiment(const CommandLine& base_command, +void LaunchBrowserUserExperiment(const base::CommandLine& base_command, InstallStatus status, bool system_level); diff --git a/chrome/service/service_process.h b/chrome/service/service_process.h index aa57987..61f6c02 100644 --- a/chrome/service/service_process.h +++ b/chrome/service/service_process.h @@ -17,16 +17,17 @@ class ServiceProcessPrefs; class ServiceIPCServer; -class CommandLine; class ServiceURLRequestContextGetter; class ServiceProcessState; +namespace base { +class CommandLine; +} + namespace net { class NetworkChangeNotifier; } -class CommandLine; - // The ServiceProcess does not inherit from ChildProcess because this // process can live independently of the browser process. // ServiceProcess Design Notes @@ -39,7 +40,7 @@ class ServiceProcess : public cloud_print::CloudPrintProxy::Client { // Initialize the ServiceProcess with the message loop that it should run on. // ServiceProcess takes ownership of |state|. bool Initialize(base::MessageLoopForUI* message_loop, - const CommandLine& command_line, + const base::CommandLine& command_line, ServiceProcessState* state); bool Teardown(); diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h index fd1fad9..855e2a7 100644 --- a/chrome/service/service_utility_process_host.h +++ b/chrome/service/service_utility_process_host.h @@ -19,9 +19,8 @@ #include "ipc/ipc_channel.h" #include "printing/pdf_render_settings.h" -class CommandLine; - namespace base { +class CommandLine; class MessageLoopProxy; class ScopedTempDir; } // namespace base @@ -133,7 +132,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored // if |no_sandbox| is true. - bool Launch(CommandLine* cmd_line, + bool Launch(base::CommandLine* cmd_line, bool no_sandbox, const base::FilePath& exposed_dir); diff --git a/chrome/test/automation/proxy_launcher.h b/chrome/test/automation/proxy_launcher.h index b97b50a..8f1359c 100644 --- a/chrome/test/automation/proxy_launcher.h +++ b/chrome/test/automation/proxy_launcher.h @@ -51,7 +51,7 @@ class ProxyLauncher { base::Closure setup_profile_callback; // Command line to launch the browser. - CommandLine command; + base::CommandLine command; // Should we supply the testing channel id on the command line? bool include_testing_id; @@ -148,7 +148,7 @@ class ProxyLauncher { bool WaitForBrowserLaunch(bool wait_for_initial_loads) WARN_UNUSED_RESULT; // Prepare command line that will be used to launch the child browser process. - void PrepareTestCommandline(CommandLine* command_line, + void PrepareTestCommandline(base::CommandLine* command_line, bool include_testing_id); bool LaunchBrowserHelper(const LaunchState& state, diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h index add31c5..a64a47d 100644 --- a/chrome/test/base/in_process_browser_test.h +++ b/chrome/test/base/in_process_browser_test.h @@ -15,6 +15,9 @@ #include "testing/gtest/include/gtest/gtest.h" namespace base { + +class CommandLine; + #if defined(OS_MACOSX) namespace mac { class ScopedNSAutoreleasePool; @@ -29,7 +32,6 @@ class ScopedCOMInitializer; } // namespace base class Browser; -class CommandLine; class Profile; namespace content { @@ -155,7 +157,7 @@ class InProcessBrowserTest : public content::BrowserTestBase { // the command line isn't a concept that we support on the Mac; AppleEvents // are the Mac solution for the same need. Any test based on these functions // doesn't apply to the Mac. - CommandLine GetCommandLineForRelaunch(); + base::CommandLine GetCommandLineForRelaunch(); #endif #if defined(OS_MACOSX) @@ -184,7 +186,7 @@ class InProcessBrowserTest : public content::BrowserTestBase { // Prepare command line that will be used to launch the child browser process // with an in-process test. - void PrepareTestCommandLine(CommandLine* command_line); + void PrepareTestCommandLine(base::CommandLine* command_line); // Browser created from CreateBrowser. Browser* browser_; diff --git a/chrome/test/base/test_launcher_utils.h b/chrome/test/base/test_launcher_utils.h index 18d46b5..24bd23d 100644 --- a/chrome/test/base/test_launcher_utils.h +++ b/chrome/test/base/test_launcher_utils.h @@ -10,14 +10,16 @@ #include "base/compiler_specific.h" #include "base/files/file_path.h" +namespace base { class CommandLine; +} // A set of utilities for test code that launches separate processes. namespace test_launcher_utils { // Appends browser switches to provided |command_line| to be used // when running under tests. -void PrepareBrowserCommandLineForTests(CommandLine* command_line); +void PrepareBrowserCommandLineForTests(base::CommandLine* command_line); // Overrides the current process' user data dir. bool OverrideUserDataDir( diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index d0771ed..497247d 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h @@ -41,7 +41,6 @@ class SpecialStoragePolicy; } class BrowserContextDependencyManager; -class CommandLine; class ExtensionSpecialStoragePolicy; class HostContentSettingsMap; class PrefServiceSyncable; diff --git a/chrome/test/chromedriver/capabilities.h b/chrome/test/chromedriver/capabilities.h index 1fea633..998c56a 100644 --- a/chrome/test/chromedriver/capabilities.h +++ b/chrome/test/chromedriver/capabilities.h @@ -18,10 +18,10 @@ #include "chrome/test/chromedriver/net/net_util.h" namespace base { +class CommandLine; class DictionaryValue; } -class CommandLine; class Status; class Switches { @@ -49,7 +49,7 @@ class Switches { size_t GetSize() const; - void AppendToCommandLine(CommandLine* command) const; + void AppendToCommandLine(base::CommandLine* command) const; std::string ToString() const; private: diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.h b/chrome/test/chromedriver/chrome/chrome_desktop_impl.h index f9c2ab6..c8e86a7 100644 --- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.h +++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.h @@ -30,7 +30,7 @@ class ChromeDesktopImpl : public ChromeImpl { ScopedVector<DevToolsEventListener>& devtools_event_listeners, scoped_ptr<PortReservation> port_reservation, base::ProcessHandle process, - const CommandLine& command, + const base::CommandLine& command, base::ScopedTempDir* user_data_dir, base::ScopedTempDir* extension_dir); virtual ~ChromeDesktopImpl(); @@ -51,11 +51,11 @@ class ChromeDesktopImpl : public ChromeImpl { // Overridden from ChromeImpl: virtual Status QuitImpl() OVERRIDE; - const CommandLine& command() const; + const base::CommandLine& command() const; private: base::ProcessHandle process_; - CommandLine command_; + base::CommandLine command_; base::ScopedTempDir user_data_dir_; base::ScopedTempDir extension_dir_; diff --git a/chrome/test/chromedriver/chrome_launcher.h b/chrome/test/chromedriver/chrome_launcher.h index 10077f8..c9dee2c 100644 --- a/chrome/test/chromedriver/chrome_launcher.h +++ b/chrome/test/chromedriver/chrome_launcher.h @@ -14,7 +14,6 @@ #include "chrome/test/chromedriver/capabilities.h" #include "chrome/test/chromedriver/net/sync_websocket_factory.h" -class CommandLine; class DevToolsEventListener; namespace base { diff --git a/chrome/test/data/webui/print_preview.h b/chrome/test/data/webui/print_preview.h index 0d4386c..599f4d5 100644 --- a/chrome/test/data/webui/print_preview.h +++ b/chrome/test/data/webui/print_preview.h @@ -14,7 +14,7 @@ class PrintPreviewWebUITest : public WebUIBrowserTest { private: // WebUIBrowserTest implementation. - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(PrintPreviewWebUITest); }; diff --git a/chrome/test/mini_installer_test/installer_test_util.h b/chrome/test/mini_installer_test/installer_test_util.h index bda2617..c55106b 100644 --- a/chrome/test/mini_installer_test/installer_test_util.h +++ b/chrome/test/mini_installer_test/installer_test_util.h @@ -79,7 +79,7 @@ bool ValidateInstall( // Run and wait for command to finish. // Returns true if successful, otherwise false. -bool RunAndWaitForCommandToFinish(CommandLine command); +bool RunAndWaitForCommandToFinish(base::CommandLine command); } // namespace diff --git a/chrome/test/mini_installer_test/switch_builder.h b/chrome/test/mini_installer_test/switch_builder.h index 017c088..94d039f 100644 --- a/chrome/test/mini_installer_test/switch_builder.h +++ b/chrome/test/mini_installer_test/switch_builder.h @@ -16,7 +16,7 @@ class SwitchBuilder { SwitchBuilder(); ~SwitchBuilder(); - const CommandLine& GetSwitches() const; + const base::CommandLine& GetSwitches() const; SwitchBuilder& AddChrome(); SwitchBuilder& AddChromeFrame(); @@ -24,7 +24,7 @@ class SwitchBuilder { SwitchBuilder& AddSystemInstall(); private: - CommandLine switches_; + base::CommandLine switches_; DISALLOW_COPY_AND_ASSIGN(SwitchBuilder); }; diff --git a/chrome/test/nacl/nacl_browsertest_util.h b/chrome/test/nacl/nacl_browsertest_util.h index cff0970..b4ed58a 100644 --- a/chrome/test/nacl/nacl_browsertest_util.h +++ b/chrome/test/nacl/nacl_browsertest_util.h @@ -62,7 +62,7 @@ class NaClBrowserTestBase : public InProcessBrowserTest { NaClBrowserTestBase(); virtual ~NaClBrowserTestBase(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; @@ -127,7 +127,7 @@ class NaClBrowserTestPnacl : public NaClBrowserTestBase { // type is not available. class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual base::FilePath::StringType Variant() OVERRIDE; diff --git a/chrome/test/perf/browser_perf_test.h b/chrome/test/perf/browser_perf_test.h index 8b723d1..250724c 100644 --- a/chrome/test/perf/browser_perf_test.h +++ b/chrome/test/perf/browser_perf_test.h @@ -7,7 +7,9 @@ #include "chrome/test/base/in_process_browser_test.h" +namespace base { class CommandLine; +} class BrowserPerfTest : public InProcessBrowserTest { public: @@ -16,7 +18,7 @@ class BrowserPerfTest : public InProcessBrowserTest { // Set up common browser perf test flags. Typically call down to this if // overridden. - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; // Prints IO performance data for use by perf graphs. void PrintIOPerfInfo(const std::string& test_name); diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index 30fc4c8..0074c9f 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -50,7 +50,7 @@ const char library_name[] = "ppapi_tests.plugin"; const char library_name[] = "libppapi_tests.so"; #endif -void AddPrivateSwitches(CommandLine* command_line) { +void AddPrivateSwitches(base::CommandLine* command_line) { // For TestRequestOSFileHandle. command_line->AppendSwitch(switches::kUnlimitedStorage); command_line->AppendSwitchASCII(switches::kAllowNaClFileHandleAPI, @@ -142,7 +142,7 @@ void PPAPITestBase::SetUp() { InProcessBrowserTest::SetUp(); } -void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { +void PPAPITestBase::SetUpCommandLine(base::CommandLine* command_line) { // The test sends us the result via a cookie. command_line->AppendSwitch(switches::kEnableFileCookies); @@ -272,7 +272,8 @@ std::string PPAPITestBase::StripPrefixes(const std::string& test_name) { void PPAPITestBase::RunTestURL(const GURL& test_url) { #if defined(OS_WIN) && defined(USE_ASH) // PPAPITests are broken in Ash browser tests (http://crbug.com/263548). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) { LOG(WARNING) << "PPAPITests are disabled for Ash browser tests."; return; } @@ -308,7 +309,7 @@ GURL PPAPITestBase::GetTestURL( PPAPITest::PPAPITest() : in_process_(true) { } -void PPAPITest::SetUpCommandLine(CommandLine* command_line) { +void PPAPITest::SetUpCommandLine(base::CommandLine* command_line) { PPAPITestBase::SetUpCommandLine(command_line); // Append the switch to register the pepper plugin. @@ -334,7 +335,7 @@ std::string PPAPITest::BuildQuery(const std::string& base, return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); } -void PPAPIPrivateTest::SetUpCommandLine(CommandLine* command_line) { +void PPAPIPrivateTest::SetUpCommandLine(base::CommandLine* command_line) { PPAPITest::SetUpCommandLine(command_line); AddPrivateSwitches(command_line); } @@ -343,18 +344,19 @@ OutOfProcessPPAPITest::OutOfProcessPPAPITest() { in_process_ = false; } -void OutOfProcessPPAPITest::SetUpCommandLine(CommandLine* command_line) { +void OutOfProcessPPAPITest::SetUpCommandLine(base::CommandLine* command_line) { PPAPITest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); } -void OutOfProcessPPAPIPrivateTest::SetUpCommandLine(CommandLine* command_line) { +void OutOfProcessPPAPIPrivateTest::SetUpCommandLine( + base::CommandLine* command_line) { OutOfProcessPPAPITest::SetUpCommandLine(command_line); AddPrivateSwitches(command_line); } -void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { +void PPAPINaClTest::SetUpCommandLine(base::CommandLine* command_line) { RETURN_IF_NO_NACL(); PPAPITestBase::SetUpCommandLine(command_line); @@ -413,7 +415,8 @@ std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base, test_case.c_str()); } -void PPAPIPrivateNaClNewlibTest::SetUpCommandLine(CommandLine* command_line) { +void PPAPIPrivateNaClNewlibTest::SetUpCommandLine( + base::CommandLine* command_line) { PPAPINaClNewlibTest::SetUpCommandLine(command_line); AddPrivateSwitches(command_line); } @@ -425,7 +428,8 @@ std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base, test_case.c_str()); } -void PPAPIPrivateNaClGLibcTest::SetUpCommandLine(CommandLine* command_line) { +void PPAPIPrivateNaClGLibcTest::SetUpCommandLine( + base::CommandLine* command_line) { PPAPINaClGLibcTest::SetUpCommandLine(command_line); AddPrivateSwitches(command_line); } @@ -437,13 +441,14 @@ std::string PPAPINaClPNaClTest::BuildQuery(const std::string& base, test_case.c_str()); } -void PPAPIPrivateNaClPNaClTest::SetUpCommandLine(CommandLine* command_line) { +void PPAPIPrivateNaClPNaClTest::SetUpCommandLine( + base::CommandLine* command_line) { PPAPINaClPNaClTest::SetUpCommandLine(command_line); AddPrivateSwitches(command_line); } void PPAPINaClTestDisallowedSockets::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { PPAPITestBase::SetUpCommandLine(command_line); base::FilePath plugin_lib; diff --git a/chrome/test/ppapi/ppapi_test.h b/chrome/test/ppapi/ppapi_test.h index e55daf1..ef76639 100644 --- a/chrome/test/ppapi/ppapi_test.h +++ b/chrome/test/ppapi/ppapi_test.h @@ -41,7 +41,7 @@ class PPAPITestBase : public InProcessBrowserTest { // InProcessBrowserTest: virtual void SetUp() OVERRIDE; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUpOnMainThread() OVERRIDE; virtual std::string BuildQuery(const std::string& base, @@ -99,7 +99,7 @@ class PPAPITest : public PPAPITestBase { public: PPAPITest(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual std::string BuildQuery(const std::string& base, const std::string& test_case) OVERRIDE; @@ -109,7 +109,7 @@ class PPAPITest : public PPAPITestBase { class PPAPIPrivateTest : public PPAPITest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; // Variant of PPAPITest that runs plugins out-of-process to test proxy @@ -118,18 +118,18 @@ class OutOfProcessPPAPITest : public PPAPITest { public: OutOfProcessPPAPITest(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; class OutOfProcessPPAPIPrivateTest : public OutOfProcessPPAPITest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; // NaCl plugin test runner for Newlib runtime. class PPAPINaClTest : public PPAPITestBase { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; // PPAPITestBase overrides. virtual void RunTest(const std::string& test_case) OVERRIDE; virtual void RunTestAndReload(const std::string& test_case) OVERRIDE; @@ -152,7 +152,7 @@ class PPAPINaClNewlibTest : public PPAPINaClTest { class PPAPIPrivateNaClNewlibTest : public PPAPINaClNewlibTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; // NaCl plugin test runner for GNU-libc runtime. @@ -164,7 +164,7 @@ class PPAPINaClGLibcTest : public PPAPINaClTest { class PPAPIPrivateNaClGLibcTest : public PPAPINaClGLibcTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; // NaCl plugin test runner for the PNaCl + Newlib runtime. @@ -176,12 +176,12 @@ class PPAPINaClPNaClTest : public PPAPINaClTest { class PPAPIPrivateNaClPNaClTest : public PPAPINaClPNaClTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; }; class PPAPINaClTestDisallowedSockets : public PPAPITestBase { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual std::string BuildQuery(const std::string& base, const std::string& test_case) OVERRIDE; diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index b364116..12c442f 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -71,7 +71,7 @@ class UITestBase { // Launches the browser with the given command line. // TODO(phajdan.jr): Make LaunchBrowser private. - void LaunchBrowser(const CommandLine& cmdline, bool clear_profile); + void LaunchBrowser(const base::CommandLine& cmdline, bool clear_profile); // Exits out browser instance. void QuitBrowser(); @@ -279,7 +279,7 @@ class UITestBase { base::FilePath test_data_directory_; // Command to launch the browser - CommandLine launch_arguments_; + base::CommandLine launch_arguments_; // The number of errors expected during the run (generally 0). size_t expected_errors_; diff --git a/cloud_print/service/win/chrome_launcher.h b/cloud_print/service/win/chrome_launcher.h index 57c92e6..723bb77 100644 --- a/cloud_print/service/win/chrome_launcher.h +++ b/cloud_print/service/win/chrome_launcher.h @@ -13,8 +13,6 @@ #include "base/memory/scoped_ptr.h" #include "base/threading/simple_thread.h" -class CommandLine; - class ChromeLauncher : public base::DelegateSimpleThread::Delegate { public: explicit ChromeLauncher(const base::FilePath& user_data); diff --git a/cloud_print/service/win/service_controller.h b/cloud_print/service/win/service_controller.h index 3b1781e..6868fbd 100644 --- a/cloud_print/service/win/service_controller.h +++ b/cloud_print/service/win/service_controller.h @@ -69,7 +69,7 @@ class ServiceController { State state_; base::string16 user_; bool is_logging_enabled_; - CommandLine command_line_; + base::CommandLine command_line_; }; #endif // CLOUD_PRINT_SERVICE_SERVICE_CONTROLLER_H_ diff --git a/cloud_print/service/win/service_utils.h b/cloud_print/service/win/service_utils.h index d4faa8e..a509772 100644 --- a/cloud_print/service/win/service_utils.h +++ b/cloud_print/service/win/service_utils.h @@ -5,13 +5,15 @@ #ifndef CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ #define CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ -class CommandLine; - #include "base/strings/string16.h" +namespace base { +class CommandLine; +} + base::string16 ReplaceLocalHostInName(const base::string16& user_name); base::string16 GetCurrentUserName(); -void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination); +void CopyChromeSwitchesFromCurrentProcess(base::CommandLine* destination); #endif // CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ diff --git a/components/nacl/browser/nacl_process_host.h b/components/nacl/browser/nacl_process_host.h index 9df7ade..758f708 100644 --- a/components/nacl/browser/nacl_process_host.h +++ b/components/nacl/browser/nacl_process_host.h @@ -21,8 +21,6 @@ #include "ppapi/shared_impl/ppapi_permissions.h" #include "url/gurl.h" -class CommandLine; - namespace content { class BrowserChildProcessHost; class BrowserPpapiHost; diff --git a/components/nacl/common/nacl_cmd_line.h b/components/nacl/common/nacl_cmd_line.h index 4e4e753..60f7f22 100644 --- a/components/nacl/common/nacl_cmd_line.h +++ b/components/nacl/common/nacl_cmd_line.h @@ -5,12 +5,16 @@ #ifndef COMPONENTS_NACL_COMMON_NACL_CMD_LINE_H_ #define COMPONENTS_NACL_COMMON_NACL_CMD_LINE_H_ +namespace base { class CommandLine; +} namespace nacl { - // Copy all the relevant arguments from the command line of the current - // process to cmd_line that will be used for launching the NaCl loader/broker. - void CopyNaClCommandLineArguments(CommandLine* cmd_line); -} + +// Copy all the relevant arguments from the command line of the current +// process to cmd_line that will be used for launching the NaCl loader/broker. +void CopyNaClCommandLineArguments(base::CommandLine* cmd_line); + +} // namespace nacl #endif // COMPONENTS_NACL_COMMON_NACL_CMD_LINE_H_ diff --git a/content/browser/android/child_process_launcher_android.h b/content/browser/android/child_process_launcher_android.h index 71a6f04..5d4ee74 100644 --- a/content/browser/android/child_process_launcher_android.h +++ b/content/browser/android/child_process_launcher_android.h @@ -21,7 +21,7 @@ typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; // The created process handle is returned to the |callback| on success, 0 is // retuned if the process could not be created. void StartChildProcess( - const CommandLine::StringVector& argv, + const base::CommandLine::StringVector& argv, const std::vector<FileDescriptorInfo>& files_to_register, const StartChildProcessCallback& callback); diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index 594c611..24bc1e7 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -17,6 +17,10 @@ #include "content/public/browser/child_process_data.h" #include "content/public/common/child_process_host_delegate.h" +namespace base { +class CommandLine; +} + namespace content { class BrowserChildProcessHostIterator; @@ -44,7 +48,7 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl virtual bool Send(IPC::Message* message) OVERRIDE; virtual void Launch( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line) OVERRIDE; + base::CommandLine* cmd_line) OVERRIDE; virtual const ChildProcessData& GetData() const OVERRIDE; virtual ChildProcessHost* GetHost() const OVERRIDE; virtual base::TerminationStatus GetTerminationStatus( diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index e04999b..8f8af82 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h @@ -11,9 +11,8 @@ #include "content/browser/browser_process_sub_thread.h" #include "content/public/browser/browser_main_runner.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; class HighResolutionTimerManager; class MessageLoop; @@ -127,12 +126,12 @@ class CONTENT_EXPORT BrowserMainLoop { void MainMessageLoopRun(); - void InitStartupTracing(const CommandLine& command_line); + void InitStartupTracing(const base::CommandLine& command_line); void EndStartupTracing(const base::FilePath& trace_file); // Members initialized on construction --------------------------------------- const MainFunctionParams& parameters_; - const CommandLine& parsed_command_line_; + const base::CommandLine& parsed_command_line_; int result_code_; // True if the non-UI threads were created. bool created_threads_; diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index faa64e7..cc8b3f5 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h @@ -11,7 +11,9 @@ #include "base/process/launch.h" #include "content/common/content_export.h" +namespace base { class CommandLine; +} namespace content { class SandboxedProcessLauncherDelegate; @@ -40,7 +42,7 @@ class CONTENT_EXPORT ChildProcessLauncher { // Takes ownership of cmd_line. ChildProcessLauncher( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line, + base::CommandLine* cmd_line, int child_process_id, Client* client); ~ChildProcessLauncher(); diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 69f70ee..d31c1a5 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -139,19 +139,19 @@ void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( } void GpuDataManagerImpl::AppendRendererCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { base::AutoLock auto_lock(lock_); private_->AppendRendererCommandLine(command_line); } void GpuDataManagerImpl::AppendGpuCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { base::AutoLock auto_lock(lock_); private_->AppendGpuCommandLine(command_line); } void GpuDataManagerImpl::AppendPluginCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { base::AutoLock auto_lock(lock_); private_->AppendPluginCommandLine(command_line); } diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index e1ed2f8..e3e92af 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -22,10 +22,13 @@ #include "content/public/common/three_d_api_types.h" #include "gpu/config/gpu_info.h" -class CommandLine; class GURL; struct WebPreferences; +namespace base { +class CommandLine; +} + namespace content { class GpuDataManagerImplPrivate; @@ -95,14 +98,14 @@ class CONTENT_EXPORT GpuDataManagerImpl // Insert disable-feature switches corresponding to preliminary gpu feature // flags into the renderer process command line. - void AppendRendererCommandLine(CommandLine* command_line) const; + void AppendRendererCommandLine(base::CommandLine* command_line) const; // Insert switches into gpu process command line: kUseGL, etc. - void AppendGpuCommandLine(CommandLine* command_line) const; + void AppendGpuCommandLine(base::CommandLine* command_line) const; // Insert switches into plugin process command line: // kDisableCoreAnimationPlugins. - void AppendPluginCommandLine(CommandLine* command_line) const; + void AppendPluginCommandLine(base::CommandLine* command_line) const; // Update WebPreferences for renderer based on blacklisting decisions. void UpdateRendererWebPrefs(WebPreferences* prefs) const; diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h index 5c8cc6f..c83ca93 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -18,6 +18,10 @@ #include "gpu/config/gpu_blacklist.h" #include "gpu/config/gpu_driver_bug_list.h" +namespace base { +class CommandLine; +} + namespace content { class CONTENT_EXPORT GpuDataManagerImplPrivate { @@ -57,11 +61,11 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { void UpdateVideoMemoryUsageStats( const GPUVideoMemoryUsageStats& video_memory_usage_stats); - void AppendRendererCommandLine(CommandLine* command_line) const; + void AppendRendererCommandLine(base::CommandLine* command_line) const; - void AppendGpuCommandLine(CommandLine* command_line) const; + void AppendGpuCommandLine(base::CommandLine* command_line) const; - void AppendPluginCommandLine(CommandLine* command_line) const; + void AppendPluginCommandLine(base::CommandLine* command_line) const; void UpdateRendererWebPrefs(WebPreferences* prefs) const; diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index e76ad9b..8ef5f19 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h @@ -23,10 +23,10 @@ #include "ipc/ipc_platform_file.h" #include "ui/surface/transport_dib.h" -class CommandLine; struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; namespace base { +class CommandLine; class MessageLoop; } @@ -274,13 +274,14 @@ class CONTENT_EXPORT RenderProcessHostImpl // Generates a command line to be used to spawn a renderer and appends the // results to |*command_line|. - void AppendRendererCommandLine(CommandLine* command_line) const; + void AppendRendererCommandLine(base::CommandLine* command_line) const; // Copies applicable command line switches from the given |browser_cmd| line // flags to the output |renderer_cmd| line flags. Not all switches will be // copied over. - void PropagateBrowserCommandLineToRenderer(const CommandLine& browser_cmd, - CommandLine* renderer_cmd) const; + void PropagateBrowserCommandLineToRenderer( + const base::CommandLine& browser_cmd, + base::CommandLine* renderer_cmd) const; // Callers can reduce the RenderProcess' priority. void SetBackgrounded(bool backgrounded); diff --git a/content/child/runtime_features.h b/content/child/runtime_features.h index 0a56f5f..81bdbf7 100644 --- a/content/child/runtime_features.h +++ b/content/child/runtime_features.h @@ -5,12 +5,14 @@ #ifndef CONTENT_CHILD_RUNTIME_FEATURES_H_ #define CONTENT_CHILD_RUNTIME_FEATURES_H_ +namespace base { class CommandLine; +} namespace content { void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( - const CommandLine& command_line); + const base::CommandLine& command_line); } // namespace content diff --git a/content/common/sandbox_win.h b/content/common/sandbox_win.h index af8f218..ac6ce90 100644 --- a/content/common/sandbox_win.h +++ b/content/common/sandbox_win.h @@ -7,7 +7,9 @@ #include "sandbox/win/src/security_level.h" +namespace base { class CommandLine; +} namespace sandbox { class BrokerServices; @@ -19,7 +21,7 @@ namespace content { // Wrapper around sandbox::TargetPolicy::SetJobLevel that checks if the sandbox // should be let to run without a job object assigned. -void SetJobLevel(const CommandLine& cmd_line, +void SetJobLevel(const base::CommandLine& cmd_line, sandbox::JobLevel job_level, uint32 ui_exceptions, sandbox::TargetPolicy* policy); diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h index 17deb5e..faf85c7 100644 --- a/content/ppapi_plugin/ppapi_thread.h +++ b/content/ppapi_plugin/ppapi_thread.h @@ -27,9 +27,8 @@ #include "base/win/scoped_handle.h" #endif -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -45,7 +44,7 @@ class PpapiThread : public ChildThread, public ppapi::proxy::PluginDispatcher::PluginDelegate, public ppapi::proxy::PluginProxyDelegate { public: - PpapiThread(const CommandLine& command_line, bool is_broker); + PpapiThread(const base::CommandLine& command_line, bool is_broker); virtual ~PpapiThread(); virtual void Shutdown() OVERRIDE; diff --git a/content/public/app/startup_helper_win.h b/content/public/app/startup_helper_win.h index e3a796a6..6a26b20 100644 --- a/content/public/app/startup_helper_win.h +++ b/content/public/app/startup_helper_win.h @@ -5,7 +5,9 @@ #ifndef CONTENT_PUBLIC_APP_STARTUP_HELPER_WIN_H_ #define CONTENT_PUBLIC_APP_STARTUP_HELPER_WIN_H_ +namespace base { class CommandLine; +} namespace sandbox { struct SandboxInterfaceInfo; @@ -28,7 +30,7 @@ void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo* sandbox_info); void RegisterInvalidParamHandler(); // Sets up the CRT's debugging macros to output to stdout. -void SetupCRT(const CommandLine& command_line); +void SetupCRT(const base::CommandLine& command_line); } // namespace content diff --git a/content/public/browser/browser_child_process_host.h b/content/public/browser/browser_child_process_host.h index 9bee9d4..a44b8d3 100644 --- a/content/public/browser/browser_child_process_host.h +++ b/content/public/browser/browser_child_process_host.h @@ -15,9 +15,8 @@ #include "content/public/common/process_type.h" #include "ipc/ipc_sender.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -45,7 +44,7 @@ class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender { // Takes ownership of |cmd_line| and |delegate|. virtual void Launch( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line) = 0; + base::CommandLine* cmd_line) = 0; virtual const ChildProcessData& GetData() const = 0; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 5e412a7..8df5c71 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -34,19 +34,19 @@ #include "content/public/browser/file_descriptor_info.h" #endif -class CommandLine; class GURL; struct WebPreferences; -namespace blink { -struct WebWindowFeatures; -} - namespace base { +class CommandLine; class DictionaryValue; class FilePath; } +namespace blink { +struct WebWindowFeatures; +} + namespace gfx { class ImageSkia; } @@ -282,7 +282,7 @@ class CONTENT_EXPORT ContentBrowserClient { // Allows the embedder to pass extra command line flags. // switches::kProcessType will already be set at this point. - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) {} // Returns the locale used by the application. @@ -605,7 +605,7 @@ class CONTENT_EXPORT ContentBrowserClient { // Populates |mappings| with all files that need to be mapped before launching // a child process. virtual void GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, std::vector<FileDescriptorInfo>* mappings) {} #endif diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h index 5aba3b6..add53dd 100644 --- a/content/public/common/content_client.h +++ b/content/public/common/content_client.h @@ -15,7 +15,6 @@ #include "content/common/content_export.h" #include "ui/base/layout.h" -class CommandLine; class GURL; namespace base { diff --git a/content/public/common/main_function_params.h b/content/public/common/main_function_params.h index b9ace95..8a2b826 100644 --- a/content/public/common/main_function_params.h +++ b/content/public/common/main_function_params.h @@ -27,7 +27,7 @@ class ScopedNSAutoreleasePool; namespace content { struct MainFunctionParams { - explicit MainFunctionParams(const CommandLine& cl) + explicit MainFunctionParams(const base::CommandLine& cl) : command_line(cl), #if defined(OS_WIN) sandbox_info(NULL), @@ -37,7 +37,7 @@ struct MainFunctionParams { ui_task(NULL) { } - const CommandLine& command_line; + const base::CommandLine& command_line; #if defined(OS_WIN) sandbox::SandboxInterfaceInfo* sandbox_info; diff --git a/content/public/common/sandbox_init.h b/content/public/common/sandbox_init.h index f709d23..313662d 100644 --- a/content/public/common/sandbox_init.h +++ b/content/public/common/sandbox_init.h @@ -10,9 +10,8 @@ #include "build/build_config.h" #include "content/common/content_export.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -59,7 +58,7 @@ CONTENT_EXPORT bool BrokerAddTargetPeer(HANDLE peer_process); // then it just has to outlive this method call. CONTENT_EXPORT base::ProcessHandle StartSandboxedProcess( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line); + base::CommandLine* cmd_line); #elif defined(OS_MACOSX) diff --git a/content/public/test/browser_test_base.h b/content/public/test/browser_test_base.h index 3dab355..7e36ce6 100644 --- a/content/public/test/browser_test_base.h +++ b/content/public/test/browser_test_base.h @@ -11,9 +11,8 @@ #include "net/test/spawned_test_server/spawned_test_server.h" #include "testing/gtest/include/gtest/gtest.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -53,7 +52,7 @@ class BrowserTestBase : public testing::Test { virtual void TearDownOnMainThread() {} // Override this to add command line flags specific to your test. - virtual void SetUpCommandLine(CommandLine* command_line) {} + virtual void SetUpCommandLine(base::CommandLine* command_line) {} // Returns the host resolver being used for the tests. Subclasses might want // to configure it inside tests. diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h index 50310c0..d4a9719 100644 --- a/content/public/test/browser_test_utils.h +++ b/content/public/test/browser_test_utils.h @@ -27,8 +27,6 @@ #include "base/win/scoped_handle.h" #endif -class CommandLine; - namespace base { class RunLoop; } diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h index d0e9d0e..4dec3ab 100644 --- a/content/public/test/render_view_test.h +++ b/content/public/test/render_view_test.h @@ -137,7 +137,7 @@ class RenderViewTest : public testing::Test { // Used to setup the process so renderers can run. scoped_ptr<RendererMainPlatformDelegate> platform_; scoped_ptr<MainFunctionParams> params_; - scoped_ptr<CommandLine> command_line_; + scoped_ptr<base::CommandLine> command_line_; #if defined(OS_MACOSX) scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h index 5cf4d0f..503547c 100644 --- a/content/public/test/test_launcher.h +++ b/content/public/test/test_launcher.h @@ -10,9 +10,8 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; class RunLoop; } @@ -33,7 +32,7 @@ class TestLauncherDelegate { public: virtual int RunTestSuite(int argc, char** argv) = 0; virtual bool AdjustChildProcessCommandLine( - CommandLine* command_line, + base::CommandLine* command_line, const base::FilePath& temp_data_dir) = 0; virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} virtual void PostRunMessageLoop() {} diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 658a47e..ff9ef65 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -73,7 +73,6 @@ #pragma warning(disable: 4250) #endif -class CommandLine; class PepperDeviceTest; class SkBitmap; struct PP_NetAddress_Private; @@ -81,6 +80,10 @@ struct FrameMsg_Navigate_Params; struct ViewMsg_PostMessage_Params; struct ViewMsg_StopFinding_Params; +namespace base { +class CommandLine; +} + namespace ui { struct SelectedFileInfo; } // namespace ui @@ -1022,7 +1025,7 @@ class CONTENT_EXPORT RenderViewImpl // Processes the command-line flags --enable-viewport, // --enable-fixed-layout[=w,h] and --enable-pinch. - void ProcessViewLayoutFlags(const CommandLine& command_line); + void ProcessViewLayoutFlags(const base::CommandLine& command_line); #if defined(OS_ANDROID) // Launch an Android content intent with the given URL. diff --git a/content/shell/browser/shell_content_browser_client.h b/content/shell/browser/shell_content_browser_client.h index c4564b6..5f01271 100644 --- a/content/shell/browser/shell_content_browser_client.h +++ b/content/shell/browser/shell_content_browser_client.h @@ -45,7 +45,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { ProtocolHandlerMap* protocol_handlers, ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE; virtual bool IsHandledURL(const GURL& url) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, const GURL& url, @@ -67,7 +67,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual void GetAdditionalMappedFilesForChildProcess( - const CommandLine& command_line, + const base::CommandLine& command_line, int child_process_id, std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; #endif diff --git a/content/test/webrtc_content_browsertest_base.h b/content/test/webrtc_content_browsertest_base.h index 885b996..8d0112c 100644 --- a/content/test/webrtc_content_browsertest_base.h +++ b/content/test/webrtc_content_browsertest_base.h @@ -4,14 +4,16 @@ #include "content/test/content_browser_test.h" +namespace base { class CommandLine; +} namespace content { // Contains stuff WebRTC browsertests have in common. class WebRtcContentBrowserTest: public ContentBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; virtual void SetUp() OVERRIDE; protected: diff --git a/extensions/browser/extensions_browser_client.h b/extensions/browser/extensions_browser_client.h index dea7d7f..b994cca 100644 --- a/extensions/browser/extensions_browser_client.h +++ b/extensions/browser/extensions_browser_client.h @@ -10,10 +10,13 @@ #include "base/memory/scoped_ptr.h" -class CommandLine; class ExtensionFunctionRegistry; class PrefService; +namespace base { +class CommandLine; +} + namespace content { class BrowserContext; class JavaScriptDialogManager; @@ -44,7 +47,7 @@ class ExtensionsBrowserClient { // Returns true if extensions have been disabled (e.g. via a command-line flag // or preference). - virtual bool AreExtensionsDisabled(const CommandLine& command_line, + virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, content::BrowserContext* context) = 0; // Returns true if the |context| is known to the embedder. diff --git a/extensions/browser/test_extensions_browser_client.cc b/extensions/browser/test_extensions_browser_client.cc index 792efc8..b9cd561 100644 --- a/extensions/browser/test_extensions_browser_client.cc +++ b/extensions/browser/test_extensions_browser_client.cc @@ -29,7 +29,7 @@ void TestExtensionsBrowserClient::SetIncognitoContext(BrowserContext* context) { bool TestExtensionsBrowserClient::IsShuttingDown() { return false; } bool TestExtensionsBrowserClient::AreExtensionsDisabled( - const CommandLine& command_line, + const base::CommandLine& command_line, BrowserContext* context) { return false; } diff --git a/extensions/browser/test_extensions_browser_client.h b/extensions/browser/test_extensions_browser_client.h index 1f1030a..538fc0c 100644 --- a/extensions/browser/test_extensions_browser_client.h +++ b/extensions/browser/test_extensions_browser_client.h @@ -24,7 +24,7 @@ class TestExtensionsBrowserClient : public ExtensionsBrowserClient { // ExtensionsBrowserClient overrides: virtual bool IsShuttingDown() OVERRIDE; - virtual bool AreExtensionsDisabled(const CommandLine& command_line, + virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, content::BrowserContext* context) OVERRIDE; virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; virtual bool IsSameContext(content::BrowserContext* first, diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h index 40143d6..90db74a 100644 --- a/extensions/common/feature_switch.h +++ b/extensions/common/feature_switch.h @@ -9,7 +9,9 @@ #include "base/basictypes.h" +namespace base { class CommandLine; +} namespace extensions { @@ -50,7 +52,7 @@ class FeatureSwitch { // by the default and override values. FeatureSwitch(const char* switch_name, DefaultValue default_value); - FeatureSwitch(const CommandLine* command_line, + FeatureSwitch(const base::CommandLine* command_line, const char* switch_name, DefaultValue default_value); @@ -61,14 +63,14 @@ class FeatureSwitch { bool IsEnabled() const; private: - void Init(const CommandLine* command_line, + void Init(const base::CommandLine* command_line, const char* switch_name, DefaultValue default_value); std::string GetLegacyEnableFlag() const; std::string GetLegacyDisableFlag() const; - const CommandLine* command_line_; + const base::CommandLine* command_line_; const char* switch_name_; bool default_value_; OverrideValue override_value_; diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index 9877ef6..039b926 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h @@ -15,7 +15,9 @@ #include "gpu/config/gpu_driver_bug_workaround_type.h" #include "gpu/gpu_export.h" +namespace base { class CommandLine; +} namespace gpu { namespace gles2 { @@ -83,7 +85,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { FeatureInfo(); // Constructor with workarounds taken from |command_line| - FeatureInfo(const CommandLine& command_line); + FeatureInfo(const base::CommandLine& command_line); // Initializes the feature information. Needs a current GL context. bool Initialize(); @@ -119,7 +121,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { ~FeatureInfo(); void AddExtensionString(const std::string& str); - void InitializeBasicState(const CommandLine& command_line); + void InitializeBasicState(const base::CommandLine& command_line); void InitializeFeatures(); Validators validators_; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index d7a8f2c..8cf0421 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -113,7 +113,7 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine( bool request_depth, bool request_stencil, bool bind_generates_resource, - const CommandLine* command_line) { + const base::CommandLine* command_line) { Framebuffer::ClearFramebufferCompleteComboMap(); gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index 16abb41..4bd06cd 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -24,7 +24,9 @@ #include "ui/gl/gl_surface_stub.h" #include "ui/gl/gl_mock.h" +namespace base { class CommandLine; +} namespace gpu { namespace gles2 { @@ -169,7 +171,7 @@ class GLES2DecoderTestBase : public testing::Test { bool request_depth, bool request_stencil, bool bind_generates_resource, - const CommandLine* command_line); + const base::CommandLine* command_line); void ResetDecoder(); diff --git a/gpu/config/gpu_util.h b/gpu/config/gpu_util.h index c10cca6..e5735a0 100644 --- a/gpu/config/gpu_util.h +++ b/gpu/config/gpu_util.h @@ -12,7 +12,9 @@ #include "build/build_config.h" #include "gpu/gpu_export.h" +namespace base { class CommandLine; +} namespace gpu { @@ -24,12 +26,12 @@ GPU_EXPORT void MergeFeatureSets( // Collect basic GPUInfo, compute the driver bug workarounds for the current // system, and append the |command_line|. -GPU_EXPORT void ApplyGpuDriverBugWorkarounds(CommandLine* command_line); +GPU_EXPORT void ApplyGpuDriverBugWorkarounds(base::CommandLine* command_line); // With provided GPUInfo, compute the driver bug workarounds for the current // system, and append the |command_line|. GPU_EXPORT void ApplyGpuDriverBugWorkarounds( - const GPUInfo& gpu_inco, CommandLine* command_line); + const GPUInfo& gpu_inco, base::CommandLine* command_line); // |str| is in the format of "feature1,feature2,...,featureN". GPU_EXPORT void StringToFeatureSet( @@ -37,7 +39,7 @@ GPU_EXPORT void StringToFeatureSet( // Get the set of workarounds from switches provided in |command_line| GPU_EXPORT std::set<int> WorkaroundsFromCommandLine( - CommandLine* command_line); + base::CommandLine* command_line); } // namespace gpu diff --git a/mojo/shell/child_process.h b/mojo/shell/child_process.h index e5ce65a..0e5ba0b 100644 --- a/mojo/shell/child_process.h +++ b/mojo/shell/child_process.h @@ -9,7 +9,9 @@ #include "base/memory/scoped_ptr.h" #include "mojo/system/embedder/scoped_platform_handle.h" +namespace base { class CommandLine; +} namespace mojo { namespace shell { @@ -26,7 +28,7 @@ class ChildProcess { // Returns null if the command line doesn't indicate that this is a child // process. |main()| should call this, and if it returns non-null it should // call |Run()| inside a main message loop. - static scoped_ptr<ChildProcess> Create(const CommandLine& command_line); + static scoped_ptr<ChildProcess> Create(const base::CommandLine& command_line); void Run(); diff --git a/mojo/system/embedder/platform_channel_pair.h b/mojo/system/embedder/platform_channel_pair.h index 411a18e..39c45a4 100644 --- a/mojo/system/embedder/platform_channel_pair.h +++ b/mojo/system/embedder/platform_channel_pair.h @@ -12,7 +12,9 @@ #include "mojo/system/embedder/scoped_platform_handle.h" #include "mojo/system/system_impl_export.h" +namespace base { class CommandLine; +} namespace mojo { namespace embedder { @@ -58,14 +60,14 @@ class MOJO_SYSTEM_IMPL_EXPORT PlatformChannelPair { // the provided data), to create a client handle connected to the server // handle (in the parent process). static ScopedPlatformHandle PassClientHandleFromParentProcess( - const CommandLine& command_line); + const base::CommandLine& command_line); // Prepares to pass the client channel to a new child process, to be launched // using |LaunchProcess()| (from base/launch.h). Modifies |*command_line| and // |*handle_passing_info| as needed. // Note: For Windows, this method only works on Vista and later. void PrepareToPassClientHandleToChildProcess( - CommandLine* command_line, + base::CommandLine* command_line, HandlePassingInformation* handle_passing_info) const; // To be called once the child process has been successfully launched, to do diff --git a/net/test/python_utils.h b/net/test/python_utils.h index 3077645..ca06021 100644 --- a/net/test/python_utils.h +++ b/net/test/python_utils.h @@ -7,9 +7,8 @@ #include "base/compiler_specific.h" -class CommandLine; - namespace base { +class CommandLine; class FilePath; } @@ -23,6 +22,6 @@ void AppendToPythonPath(const base::FilePath& dir); bool GetPyProtoPath(base::FilePath* dir); // Returns the command that should be used to launch Python. -bool GetPythonCommand(CommandLine* python_cmd) WARN_UNUSED_RESULT; +bool GetPythonCommand(base::CommandLine* python_cmd) WARN_UNUSED_RESULT; #endif // NET_TEST_PYTHON_UTILS_H_ diff --git a/net/test/spawned_test_server/local_test_server.cc b/net/test/spawned_test_server/local_test_server.cc index 7ee12b9..6516136 100644 --- a/net/test/spawned_test_server/local_test_server.cc +++ b/net/test/spawned_test_server/local_test_server.cc @@ -22,7 +22,7 @@ namespace { bool AppendArgumentFromJSONValue(const std::string& key, const base::Value& value_node, - CommandLine* command_line) { + base::CommandLine* command_line) { std::string argument_name = "--" + key; switch (value_node.GetType()) { case base::Value::TYPE_NULL: @@ -198,7 +198,8 @@ bool LocalTestServer::SetPythonPath() const { return true; } -bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { +bool LocalTestServer::AddCommandLineArguments( + base::CommandLine* command_line) const { base::DictionaryValue arguments_dict; if (!GenerateArguments(&arguments_dict)) return false; diff --git a/net/test/spawned_test_server/local_test_server.h b/net/test/spawned_test_server/local_test_server.h index d916835..334c434 100644 --- a/net/test/spawned_test_server/local_test_server.h +++ b/net/test/spawned_test_server/local_test_server.h @@ -16,7 +16,9 @@ #include "base/win/scoped_handle.h" #endif +namespace base { class CommandLine; +} namespace net { @@ -74,7 +76,7 @@ class LocalTestServer : public BaseTestServer { // Adds the command line arguments for the Python test server to // |command_line|. Returns true on success. - virtual bool AddCommandLineArguments(CommandLine* command_line) const + virtual bool AddCommandLineArguments(base::CommandLine* command_line) const WARN_UNUSED_RESULT; // Returns the actual path of document root for test cases. This function diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc index ea9cab6..67911ed 100644 --- a/net/test/spawned_test_server/local_test_server_posix.cc +++ b/net/test/spawned_test_server/local_test_server_posix.cc @@ -106,7 +106,7 @@ bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { // the same environment as the TestServer. VLOG(1) << "LaunchPython called with PYTHONPATH = " << getenv(kPythonPathEnv); - CommandLine python_command(CommandLine::NO_PROGRAM); + base::CommandLine python_command(base::CommandLine::NO_PROGRAM); if (!GetPythonCommand(&python_command)) return false; diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc index cadebe9..726a581 100644 --- a/net/test/spawned_test_server/local_test_server_win.cc +++ b/net/test/spawned_test_server/local_test_server_win.cc @@ -141,7 +141,7 @@ ScopedPath::~ScopedPath() { namespace net { bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { - CommandLine python_command(CommandLine::NO_PROGRAM); + base::CommandLine python_command(base::CommandLine::NO_PROGRAM); if (!GetPythonCommand(&python_command)) return false; diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h index 8ea37ea..a5b9112 100644 --- a/net/tools/quic/quic_client.h +++ b/net/tools/quic/quic_client.h @@ -82,7 +82,8 @@ class QuicClient : public EpollCallbackInterface, // Sends a request simple GET for each URL in |args|, and then waits for // each to complete. - void SendRequestsAndWaitForResponse(const CommandLine::StringVector& args); + void SendRequestsAndWaitForResponse(const + base::CommandLine::StringVector& args); // Returns a newly created QuicSpdyClientStream, owned by the // QuicClient. diff --git a/remoting/host/win/host_service.h b/remoting/host/win/host_service.h index 3c6b757..855f37c 100644 --- a/remoting/host/win/host_service.h +++ b/remoting/host/win/host_service.h @@ -15,9 +15,8 @@ #include "base/synchronization/waitable_event.h" #include "remoting/host/win/wts_terminal_monitor.h" -class CommandLine; - namespace base { +class CommandLine; class SingleThreadTaskRunner; } // namespace base @@ -32,7 +31,7 @@ class HostService : public WtsTerminalMonitor { static HostService* GetInstance(); // This function parses the command line and selects the action routine. - bool InitWithCommandLine(const CommandLine* command_line); + bool InitWithCommandLine(const base::CommandLine* command_line); // Invoke the choosen action routine. int Run(); diff --git a/remoting/host/win/launch_process_with_token.h b/remoting/host/win/launch_process_with_token.h index e3d11f1..55c27bf 100644 --- a/remoting/host/win/launch_process_with_token.h +++ b/remoting/host/win/launch_process_with_token.h @@ -32,7 +32,7 @@ bool CreateSessionToken(uint32 session_id, base::win::ScopedHandle* token_out); // If |inherit_handles| is true |g_inherit_handles_lock| should be taken while // any inheritable handles are open. bool LaunchProcessWithToken(const base::FilePath& binary, - const CommandLine::StringType& command_line, + const base::CommandLine::StringType& command_line, HANDLE user_token, SECURITY_ATTRIBUTES* process_attributes, SECURITY_ATTRIBUTES* thread_attributes, diff --git a/remoting/host/win/unprivileged_process_delegate.h b/remoting/host/win/unprivileged_process_delegate.h index 230da6e..435958c 100644 --- a/remoting/host/win/unprivileged_process_delegate.h +++ b/remoting/host/win/unprivileged_process_delegate.h @@ -15,9 +15,8 @@ #include "ipc/ipc_listener.h" #include "remoting/host/win/worker_process_launcher.h" -class CommandLine; - namespace base { +class CommandLine; class SingleThreadTaskRunner; } // namespace base @@ -37,7 +36,7 @@ class UnprivilegedProcessDelegate public: UnprivilegedProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - scoped_ptr<CommandLine> target_command); + scoped_ptr<base::CommandLine> target_command); virtual ~UnprivilegedProcessDelegate(); // WorkerProcessLauncher::Delegate implementation. @@ -59,7 +58,7 @@ class UnprivilegedProcessDelegate scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; // Command line of the launched process. - scoped_ptr<CommandLine> target_command_; + scoped_ptr<base::CommandLine> target_command_; // The server end of the IPC channel used to communicate to the worker // process. diff --git a/remoting/host/win/wts_session_process_delegate.h b/remoting/host/win/wts_session_process_delegate.h index a953209..cfe856e 100644 --- a/remoting/host/win/wts_session_process_delegate.h +++ b/remoting/host/win/wts_session_process_delegate.h @@ -12,9 +12,8 @@ #include "base/threading/non_thread_safe.h" #include "remoting/host/win/worker_process_launcher.h" -class CommandLine; - namespace base { +class CommandLine; class SingleThreadTaskRunner; } // namespace base @@ -32,7 +31,7 @@ class WtsSessionProcessDelegate public: WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - scoped_ptr<CommandLine> target, + scoped_ptr<base::CommandLine> target, bool launch_elevated, const std::string& channel_security); ~WtsSessionProcessDelegate(); diff --git a/skia/ext/image_operations_bench.cc b/skia/ext/image_operations_bench.cc index 78e127d..617c464 100644 --- a/skia/ext/image_operations_bench.cc +++ b/skia/ext/image_operations_bench.cc @@ -144,7 +144,7 @@ class Benchmark { method_(kDefaultResizeMethod) {} // Returns true if command line parsing was successful, false otherwise. - bool ParseArgs(const CommandLine* command_line); + bool ParseArgs(const base::CommandLine* command_line); // Returns true if successful, false otherwise. bool Run() const; @@ -176,11 +176,11 @@ void Benchmark::Usage() { printf("\n -help: prints this help and exits\n"); } -bool Benchmark::ParseArgs(const CommandLine* command_line) { - const CommandLine::SwitchMap& switches = command_line->GetSwitches(); +bool Benchmark::ParseArgs(const base::CommandLine* command_line) { + const base::CommandLine::SwitchMap& switches = command_line->GetSwitches(); bool fNeedHelp = false; - for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); + for (base::CommandLine::SwitchMap::const_iterator iter = switches.begin(); iter != switches.end(); ++iter) { const std::string& s = iter->first; @@ -262,14 +262,14 @@ bool Benchmark::Run() const { class CommandLineAutoReset { public: CommandLineAutoReset(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); } ~CommandLineAutoReset() { - CommandLine::Reset(); + base::CommandLine::Reset(); } - const CommandLine* Get() const { - return CommandLine::ForCurrentProcess(); + const base::CommandLine* Get() const { + return base::CommandLine::ForCurrentProcess(); } }; diff --git a/sync/test/local_sync_test_server.cc b/sync/test/local_sync_test_server.cc index ede4b77..e8a1096 100644 --- a/sync/test/local_sync_test_server.cc +++ b/sync/test/local_sync_test_server.cc @@ -32,7 +32,7 @@ LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) LocalSyncTestServer::~LocalSyncTestServer() {} bool LocalSyncTestServer::AddCommandLineArguments( - CommandLine* command_line) const { + base::CommandLine* command_line) const { if (!LocalTestServer::AddCommandLineArguments(command_line)) return false; if (xmpp_port_ != 0) { diff --git a/sync/test/local_sync_test_server.h b/sync/test/local_sync_test_server.h index 3cd9e55..5d1e5ca 100644 --- a/sync/test/local_sync_test_server.h +++ b/sync/test/local_sync_test_server.h @@ -27,7 +27,7 @@ class LocalSyncTestServer : public net::LocalTestServer { // Overriden from net::LocalTestServer. virtual bool AddCommandLineArguments( - CommandLine* command_line) const OVERRIDE; + base::CommandLine* command_line) const OVERRIDE; virtual bool SetPythonPath() const OVERRIDE; virtual bool GetTestServerPath( base::FilePath* testserver_path) const OVERRIDE; diff --git a/third_party/libjingle/overrides/init_webrtc.h b/third_party/libjingle/overrides/init_webrtc.h index acafe50..fd78e76 100644 --- a/third_party/libjingle/overrides/init_webrtc.h +++ b/third_party/libjingle/overrides/init_webrtc.h @@ -9,7 +9,9 @@ #include "base/logging.h" #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" +namespace base { class CommandLine; +} namespace cricket { class MediaEngineInterface; @@ -39,7 +41,7 @@ typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( // The reason we get pointers to these functions this way is to avoid having // to go through GetProcAddress et al and rely on specific name mangling. typedef bool (*InitializeModuleFunction)( - const CommandLine& command_line, + const base::CommandLine& command_line, #if !defined(OS_MACOSX) && !defined(OS_ANDROID) AllocateFunction alloc, DellocateFunction dealloc, diff --git a/tools/android/common/daemon.h b/tools/android/common/daemon.h index 0c16401..99faf72 100644 --- a/tools/android/common/daemon.h +++ b/tools/android/common/daemon.h @@ -5,13 +5,15 @@ #ifndef TOOLS_ANDROID_COMMON_DAEMON_H_ #define TOOLS_ANDROID_COMMON_DAEMON_H_ +namespace base { class CommandLine; +} namespace tools { -bool HasHelpSwitch(const CommandLine& command_line); +bool HasHelpSwitch(const base::CommandLine& command_line); -bool HasNoSpawnDaemonSwitch(const CommandLine& command_line); +bool HasNoSpawnDaemonSwitch(const base::CommandLine& command_line); void ShowHelp(const char* program, const char* extra_title, diff --git a/tools/gn/setup.h b/tools/gn/setup.h index 4d8d29b..0a5c342 100644 --- a/tools/gn/setup.h +++ b/tools/gn/setup.h @@ -20,10 +20,13 @@ #include "tools/gn/token.h" #include "tools/gn/toolchain.h" -class CommandLine; class InputFile; class ParseNode; +namespace base { +class CommandLine; +} + extern const char kDotfile_Help[]; // Base class for code shared between Setup and DependentSetup. @@ -95,10 +98,10 @@ class Setup : public CommonSetup { private: // Fills build arguments. Returns true on success. - bool FillArguments(const CommandLine& cmdline); + bool FillArguments(const base::CommandLine& cmdline); // Fills the root directory into the settings. Returns true on success. - bool FillSourceDir(const CommandLine& cmdline); + bool FillSourceDir(const base::CommandLine& cmdline); // Fills the build directory given the value the user has specified. // Must happen after FillSourceDir so we can resolve source-relative @@ -112,7 +115,7 @@ class Setup : public CommonSetup { // Run config file. bool RunConfigFile(); - bool FillOtherConfig(const CommandLine& cmdline); + bool FillOtherConfig(const base::CommandLine& cmdline); Scheduler scheduler_; diff --git a/tools/gn/trace.h b/tools/gn/trace.h index b795bf77..61811a7 100644 --- a/tools/gn/trace.h +++ b/tools/gn/trace.h @@ -70,7 +70,7 @@ class ScopedTrace { ~ScopedTrace(); void SetToolchain(const Label& label); - void SetCommandLine(const CommandLine& cmdline); + void SetCommandLine(const base::CommandLine& cmdline); void Done(); diff --git a/ui/gfx/gtk_util.h b/ui/gfx/gtk_util.h index 91f864b..7607603 100644 --- a/ui/gfx/gtk_util.h +++ b/ui/gfx/gtk_util.h @@ -14,9 +14,12 @@ typedef struct _GdkPixbuf GdkPixbuf; typedef struct _GdkRegion GdkRegion; typedef struct _GdkCursor GdkCursor; -class CommandLine; class SkBitmap; +namespace base { +class CommandLine; +} + namespace gfx { class Rect; @@ -24,8 +27,8 @@ class Rect; // Call gtk_init() / gdk_init() using the argc and argv from command_line. // These init functions want an argc and argv that they can mutate; we provide // those, but leave the original CommandLine unaltered. -GFX_EXPORT void GtkInitFromCommandLine(const CommandLine& command_line); -GFX_EXPORT void GdkInitFromCommandLine(const CommandLine& command_line); +GFX_EXPORT void GtkInitFromCommandLine(const base::CommandLine& command_line); +GFX_EXPORT void GdkInitFromCommandLine(const base::CommandLine& command_line); // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so // it is an expensive operation. The returned GdkPixbuf will have a refcount of diff --git a/win8/delegate_execute/command_execute_impl.h b/win8/delegate_execute/command_execute_impl.h index f27bf7a..72e1085 100644 --- a/win8/delegate_execute/command_execute_impl.h +++ b/win8/delegate_execute/command_execute_impl.h @@ -94,7 +94,7 @@ class ATL_NO_VTABLE DECLSPEC_UUID("071BB5F2-85A4-424F-BFE7-5F1609BE4C2C") EC_HOST_UI_MODE GetLaunchMode(); CComPtr<IShellItemArray> item_array_; - CommandLine parameters_; + base::CommandLine parameters_; base::FilePath chrome_exe_; STARTUPINFO start_info_; base::string16 verb_; diff --git a/win8/delegate_execute/delegate_execute_operation.h b/win8/delegate_execute/delegate_execute_operation.h index 91e2231..26bc19e 100644 --- a/win8/delegate_execute/delegate_execute_operation.h +++ b/win8/delegate_execute/delegate_execute_operation.h @@ -12,7 +12,9 @@ #include "base/files/file_path.h" #include "base/strings/string16.h" +namespace base { class CommandLine; +} namespace delegate_execute { @@ -43,7 +45,7 @@ class DelegateExecuteOperation { DelegateExecuteOperation(); ~DelegateExecuteOperation(); - bool Init(const CommandLine* cmd_line); + bool Init(const base::CommandLine* cmd_line); OperationType operation_type() const { return operation_type_; diff --git a/win8/delegate_execute/delegate_execute_util.h b/win8/delegate_execute/delegate_execute_util.h index 4f32e96..eee033a 100644 --- a/win8/delegate_execute/delegate_execute_util.h +++ b/win8/delegate_execute/delegate_execute_util.h @@ -15,13 +15,13 @@ class FilePath; namespace delegate_execute { // Returns a CommandLine with an empty program parsed from |params|. -CommandLine CommandLineFromParameters(const wchar_t* params); +base::CommandLine CommandLineFromParameters(const wchar_t* params); // Returns a CommandLine to launch |chrome_exe| with all switches and arguments // from |params| plus an optional |argument|. -CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, - const CommandLine& params, - const base::string16& argument); +base::CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, + const base::CommandLine& params, + const base::string16& argument); // Returns a properly quoted command-line string less the program (argv[0]) // containing |switch|. |