diff options
| author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-13 23:56:51 +0000 |
|---|---|---|
| committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-13 23:56:51 +0000 |
| commit | 4287a3dba847dce805997314fcd560a5dadc1738 (patch) | |
| tree | bd69a1f4c802d5df31ac5fadeb13732984d63821 | |
| parent | 7daebb52b22ca0e87f3b595beaa1d166a9002c5a (diff) | |
| download | chromium_src-4287a3dba847dce805997314fcd560a5dadc1738.zip chromium_src-4287a3dba847dce805997314fcd560a5dadc1738.tar.gz chromium_src-4287a3dba847dce805997314fcd560a5dadc1738.tar.bz2 | |
Remove content dependency on chrome/browser/accessibility/browser_accessibility_state.h and chrome/common/chrome_switches.h.
BUG=76697,85932
Review URL: http://codereview.chromium.org/7046114
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88923 0039d316-1c4b-4281-b951-d872f2087c98
30 files changed, 144 insertions, 118 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 4db7497..20d2791 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1215,6 +1215,11 @@ bool IsCrashReportingEnabled(const PrefService* local_state) { int BrowserMain(const MainFunctionParams& parameters) { TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); + // Override the default ContentBrowserClient to let Chrome participate in + // content logic. + chrome::ChromeContentBrowserClient browser_client; + content::GetContentClient()->set_browser(&browser_client); + // If we're running tests (ui_task is non-null). if (parameters.ui_task) browser_defaults::enable_help_app = false; @@ -1462,11 +1467,6 @@ int BrowserMain(const MainFunctionParams& parameters) { SecKeychainAddCallback(&KeychainCallback, 0, NULL); #endif - // Override the default ContentBrowserClient to let Chrome participate in - // content logic. Must be done before any tabs or profiles are created. - chrome::ChromeContentBrowserClient browser_client; - content::GetContentClient()->set_browser(&browser_client); - CreateChildThreads(browser_process.get()); #if defined(OS_CHROMEOS) diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 4ad318d..03e1755 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "chrome/app/breakpad_mac.h" +#include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/chrome_plugin_message_filter.h" @@ -135,6 +136,9 @@ void ChromeContentBrowserClient::RenderViewHostCreated( new DevToolsHandler(render_view_host); new ExtensionMessageHandler(render_view_host); + if (BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) + render_view_host->EnableRendererAccessibility(); + InitRenderViewHostForExtensions(render_view_host); } @@ -244,11 +248,77 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( // in the browser process. if (!g_browser_process->safe_browsing_detection_service()) command_line->AppendSwitch(switches::kDisableClientSidePhishingDetection); + + static const char* const kSwitchNames[] = { + switches::kAllowHTTPBackgroundPage, + switches::kAllowScriptingGallery, + switches::kAppsCheckoutURL, + switches::kAppsGalleryURL, + switches::kDebugPrint, +#if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) + // Enabled by default in Google Chrome builds, except on CrOS. + switches::kDisablePrintPreview, +#else + // Disabled by default in Chromium builds and on CrOS. + switches::kEnablePrintPreview, +#endif + switches::kDomAutomationController, + switches::kDumpHistogramsOnExit, + switches::kEnableClickToPlay, + switches::kEnableCrxlessWebApps, + switches::kEnableExperimentalExtensionApis, + switches::kEnableInBrowserThumbnailing, + switches::kEnableIPCFuzzing, + switches::kEnableNaCl, + switches::kEnableRemoting, + switches::kEnableResourceContentSettings, + switches::kEnableSearchProviderApiV2, + switches::kEnableWatchdog, + switches::kExperimentalSpellcheckerFeatures, + switches::kMemoryProfiling, + switches::kMessageLoopHistogrammer, + switches::kPpapiFlashArgs, + switches::kPpapiFlashInProcess, + switches::kPpapiFlashPath, + switches::kPpapiFlashVersion, + switches::kProfilingAtStart, + switches::kProfilingFile, + switches::kProfilingFlush, + switches::kRemoteShellPort, + switches::kSilentDumpOnDCHECK, + }; + + command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, + arraysize(kSwitchNames)); } else if (process_type == switches::kUtilityProcess) { if (browser_command_line.HasSwitch( switches::kEnableExperimentalExtensionApis)) { command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); } + } else if (process_type == switches::kPluginProcess) { + static const char* const kSwitchNames[] = { + #if defined(OS_CHROMEOS) + switches::kLoginProfile, + #endif + switches::kMemoryProfiling, + switches::kSilentDumpOnDCHECK, + switches::kUserDataDir, + }; + + command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, + arraysize(kSwitchNames)); + } else if (process_type == switches::kZygoteProcess) { + static const char* const kSwitchNames[] = { + switches::kEnableRemoting, + switches::kUserDataDir, // Make logs go to the right file. + // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. + switches::kPpapiFlashInProcess, + switches::kPpapiFlashPath, + switches::kPpapiFlashVersion, + }; + + command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, + arraysize(kSwitchNames)); } } diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 08b23d3..d1299a8 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -169,15 +169,6 @@ const char kDeviceManagementUrl[] = "device-management-url"; // Triggers a pletora of diagnostic modes. const char kDiagnostics[] = "diagnostics"; -// Disable gpu-accelerated 2d canvas. -const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas"; - -// Disables the hardware acceleration of 3D CSS and animation. -const char kDisableAcceleratedLayers[] = "disable-accelerated-layers"; - -// Disables GPU accelerated video display. -const char kDisableAcceleratedVideo[] = "disable-accelerated-video"; - // Replaces the audio IPC layer for <audio> and <video> with a mock audio // device, useful when using remote desktop or machines without sound cards. // This is temporary until we fix the underlying problem. @@ -222,11 +213,6 @@ const char kDisableExtensionsFileAccessCheck[] = // Disables the sandbox for the built-in flash player. const char kDisableFlashSandbox[] = "disable-flash-sandbox"; -// Suppresses hang monitor dialogs in renderer processes. This may allow slow -// unload handlers on a page to prevent the tab from closing, but the Task -// Manager can be used to terminate the offending process in this case. -const char kDisableHangMonitor[] = "disable-hang-monitor"; - // Disable the use of the HistoryQuickProvider for autocomplete results. const char kDisableHistoryQuickProvider[] = "disable-history-quick-provider"; @@ -267,9 +253,6 @@ const char kDisablePromptOnRepost[] = "disable-prompt-on-repost"; // this option is specified or not. const char kDisableRemoteFonts[] = "disable-remote-fonts"; -// Turns off the accessibility in the renderer. -const char kDisableRendererAccessibility[] = "disable-renderer-accessibility"; - // Prevents the URLs of BackgroundContents from being remembered and re-launched // when the browser restarts. const char kDisableRestoreBackgroundContents[] = @@ -358,9 +341,6 @@ const char kDomAutomationController[] = "dom-automation"; // scripts. const char kDumpHistogramsOnExit[] = "dump-histograms-on-exit"; -// Enables the hardware acceleration of plugins. -const char kEnableAcceleratedPlugins[] = "enable-accelerated-plugins"; - // Enables AeroPeek for each tab. (This switch only works on Windows 7). const char kEnableAeroPeekTabs[] = "enable-aero-peek-tabs"; @@ -563,11 +543,6 @@ const char kForceAppsPromoVisible[] = "force-apps-promo-visible"; // the base layer even when compositing is not strictly required. const char kForceCompositingMode[] = "force-compositing-mode"; -// Force renderer accessibility to be on instead of enabling it on demand when -// a screen reader is detected. The disable-renderer-accessibility switch -// overrides this if present. -const char kForceRendererAccessibility[] = "force-renderer-accessibility"; - // Specifies a custom name for the GSSAPI library to load. const char kGSSAPILibraryName[] = "gssapi-library-name"; @@ -623,9 +598,6 @@ const char kHostResolverRules[] = "host-resolver-rules"; // <profile_dir>/Default/TransportSecurity const char kHstsHosts[] = "hsts-hosts"; -// Ignores GPU blacklist. -const char kIgnoreGpuBlacklist[] = "ignore-gpu-blacklist"; - // Perform importing from another browser. The value associated with this // setting encodes the target browser and what items to import. const char kImport[] = "import"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 9ef5000..86e17c9 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -62,9 +62,6 @@ extern const char kDebugEnableFrameToggle[]; extern const char kDebugPrint[]; extern const char kDeviceManagementUrl[]; extern const char kDiagnostics[]; -extern const char kDisableAccelerated2dCanvas[]; -extern const char kDisableAcceleratedLayers[]; -extern const char kDisableAcceleratedVideo[]; extern const char kDisableAuthNegotiateCnameLookup[]; extern const char kDisableBackgroundMode[]; extern const char kDisableBackgroundNetworking[]; @@ -74,7 +71,6 @@ extern const char kDisableCustomJumpList[]; extern const char kDisableExtensionsFileAccessCheck[]; extern const char kDisableExtensions[]; extern const char kDisableFlashSandbox[]; -extern const char kDisableHangMonitor[]; extern const char kDisableHistoryQuickProvider[]; extern const char kDisableHistoryURLProvider[]; extern const char kDisableInteractiveFormValidation[]; @@ -85,7 +81,6 @@ extern const char kDisableNewTabFirstRun[]; extern const char kDisablePreconnect[]; extern const char kDisablePromptOnRepost[]; extern const char kDisableRemoteFonts[]; -extern const char kDisableRendererAccessibility[]; extern const char kDisableRestoreBackgroundContents[]; extern const char kDisableSiteSpecificQuirks[]; extern const char kDisableSSLFalseStart[]; @@ -110,7 +105,6 @@ extern const char kDnsPrefetchDisable[]; extern const char kDnsServer[]; extern const char kDomAutomationController[]; extern const char kDumpHistogramsOnExit[]; -extern const char kEnableAcceleratedPlugins[]; extern const char kEnableAeroPeekTabs[]; extern const char kEnableAuthNegotiatePort[]; extern const char kEnableClearServerData[]; @@ -166,7 +160,6 @@ extern const char kFocusExistingTabOnOpen[]; extern const char kFirstRun[]; extern const char kForceAppsPromoVisible[]; extern const char kForceCompositingMode[]; -extern const char kForceRendererAccessibility[]; extern const char kForceStubLibcros[]; extern const char kGSSAPILibraryName[]; extern const char kHelp[]; @@ -178,7 +171,6 @@ extern const char kHostResolverParallelism[]; extern const char kHostResolverRetryAttempts[]; extern const char kHostResolverRules[]; extern const char kHstsHosts[]; -extern const char kIgnoreGpuBlacklist[]; extern const char kImport[]; extern const char kImportFromFile[]; extern const char kIncognito[]; diff --git a/content/browser/DEPS b/content/browser/DEPS index 3cea607..2977484 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -4,8 +4,6 @@ include_rules = [ # Listing of the remaining #chrome includes in content\browser. People are # actively working on reducing this to 0. Do not add any more! - "+chrome/browser/accessibility/browser_accessibility_state.h", - "+chrome/browser/browser_url_handler.h", # http://crbug.com/84078 @@ -33,7 +31,6 @@ include_rules = [ "+chrome/browser/tab_contents/render_view_host_delegate_helper.h", "+chrome/common/chrome_constants.h", - "+chrome/common/chrome_switches.h", "+chrome/common/chrome_paths.h", "+chrome/common/logging_chrome.h", diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc index ad7bafd..0d30143 100644 --- a/content/browser/browser_child_process_host.cc +++ b/content/browser/browser_child_process_host.cc @@ -14,11 +14,11 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/resource_message_filter.h" #include "content/browser/trace_message_filter.h" +#include "content/common/content_switches.h" #include "content/common/notification_service.h" #include "content/common/plugin_messages.h" #include "content/common/process_watcher.h" diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc index c440f4d..7739d42 100644 --- a/content/browser/browsing_instance.cc +++ b/content/browser/browsing_instance.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "base/logging.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/content_browser_client.h" #include "content/browser/site_instance.h" #include "content/browser/webui/web_ui_factory.h" #include "content/common/content_client.h" +#include "content/common/content_switches.h" #include "content/common/url_constants.h" // static diff --git a/content/browser/geolocation/core_location_provider_mac.mm b/content/browser/geolocation/core_location_provider_mac.mm index ab2713e..2958872 100644 --- a/content/browser/geolocation/core_location_provider_mac.mm +++ b/content/browser/geolocation/core_location_provider_mac.mm @@ -6,8 +6,8 @@ #include "base/logging.h" #include "base/command_line.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/geolocation/core_location_data_provider_mac.h" +#include "content/common/content_switches.h" CoreLocationProviderMac::CoreLocationProviderMac() : is_updating_(false) { diff --git a/content/browser/geolocation/gateway_data_provider_linux.cc b/content/browser/geolocation/gateway_data_provider_linux.cc index 6d05b75..59cd33a 100644 --- a/content/browser/geolocation/gateway_data_provider_linux.cc +++ b/content/browser/geolocation/gateway_data_provider_linux.cc @@ -23,9 +23,9 @@ #include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/geolocation/empty_device_data_provider.h" #include "content/browser/geolocation/gateway_data_provider_common.h" +#include "content/common/content_switches.h" namespace { const unsigned int kMaxArpIterations = 30; diff --git a/content/browser/geolocation/gateway_data_provider_win.cc b/content/browser/geolocation/gateway_data_provider_win.cc index e7bfee1..e3d635d 100644 --- a/content/browser/geolocation/gateway_data_provider_win.cc +++ b/content/browser/geolocation/gateway_data_provider_win.cc @@ -11,8 +11,8 @@ #include "base/command_line.h" #include "base/utf_string_conversions.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/geolocation/empty_device_data_provider.h" +#include "content/common/content_switches.h" namespace { diff --git a/content/browser/geolocation/win7_location_api_win.cc b/content/browser/geolocation/win7_location_api_win.cc index 2107dd2f..67de0d1 100644 --- a/content/browser/geolocation/win7_location_api_win.cc +++ b/content/browser/geolocation/win7_location_api_win.cc @@ -10,7 +10,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" -#include "chrome/common/chrome_switches.h" +#include "content/common/content_switches.h" #include "content/common/geoposition.h" namespace { diff --git a/content/browser/gpu/gpu_data_manager.cc b/content/browser/gpu/gpu_data_manager.cc index d36e9a6..fdcdd63 100644 --- a/content/browser/gpu/gpu_data_manager.cc +++ b/content/browser/gpu/gpu_data_manager.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "base/metrics/histogram.h" #include "base/string_number_conversions.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/gpu/gpu_blacklist.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/common/content_client.h" +#include "content/common/content_switches.h" #include "content/common/gpu/gpu_messages.h" #include "content/gpu/gpu_info_collector.h" #include "ui/gfx/gl/gl_implementation.h" diff --git a/content/browser/in_process_webkit/dom_storage_uitest.cc b/content/browser/in_process_webkit/dom_storage_uitest.cc index 2889332..372236c 100644 --- a/content/browser/in_process_webkit/dom_storage_uitest.cc +++ b/content/browser/in_process_webkit/dom_storage_uitest.cc @@ -5,10 +5,10 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/test/test_timeouts.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_layout_test.h" #include "chrome/test/ui_test_utils.h" +#include "content/common/content_switches.h" #include "net/base/net_util.h" static const char* kRootFiles[] = { diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index d552cfe..fc472b3 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -9,7 +9,6 @@ #include "base/scoped_temp_dir.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/testing_profile.h" #include "chrome/test/thread_test_helper.h" @@ -17,6 +16,7 @@ #include "content/browser/in_process_webkit/indexed_db_context.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_switches.h" // This browser test is aimed towards exercising the IndexedDB bindings and // the actual implementation that lives in the browser side (in_process_webkit). diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index 9b660e9..c1b9111 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -20,7 +20,6 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" @@ -28,6 +27,7 @@ #include "content/browser/plugin_service.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/renderer_host/resource_message_filter.h" +#include "content/common/content_switches.h" #include "content/common/plugin_messages.h" #include "content/common/resource_messages.h" #include "ipc/ipc_switches.h" @@ -191,18 +191,12 @@ bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, switches::kEnableStatsTable, switches::kFullMemoryCrashReport, switches::kLoggingLevel, -#if defined(OS_CHROMEOS) - switches::kLoginProfile, -#endif switches::kLogPluginMessages, - switches::kMemoryProfiling, switches::kNoSandbox, switches::kPluginStartupDialog, - switches::kSilentDumpOnDCHECK, switches::kTestSandbox, switches::kUseGL, switches::kUserAgent, - switches::kUserDataDir, switches::kV, }; diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc index 1cfea31..bbd2fe9 100644 --- a/content/browser/plugin_service.cc +++ b/content/browser/plugin_service.cc @@ -15,13 +15,13 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/browser/ppapi_plugin_process_host.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/resource_context.h" +#include "content/common/content_switches.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "content/common/pepper_plugin_registry.h" diff --git a/content/browser/plugin_service_browsertest.cc b/content/browser/plugin_service_browsertest.cc index 740b85f..437e403 100644 --- a/content/browser/plugin_service_browsertest.cc +++ b/content/browser/plugin_service_browsertest.cc @@ -7,10 +7,10 @@ #include "base/command_line.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/browser_thread.h" +#include "content/common/content_switches.h" #include "testing/gmock/include/gmock/gmock.h" #include "webkit/plugins/npapi/plugin_list.h" diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 2f6b7e5..738cefe 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -8,9 +8,9 @@ #include "base/file_path.h" #include "base/process_util.h" #include "base/utf_string_conversions.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/plugin_service.h" #include "content/browser/renderer_host/render_message_filter.h" +#include "content/common/content_switches.h" #include "content/common/pepper_plugin_registry.h" #include "ipc/ipc_switches.h" #include "ppapi/proxy/ppapi_messages.h" diff --git a/content/browser/renderer_host/backing_store_manager.cc b/content/browser/renderer_host/backing_store_manager.cc index fd9cca7..b39a24f 100644 --- a/content/browser/renderer_host/backing_store_manager.cc +++ b/content/browser/renderer_host/backing_store_manager.cc @@ -8,9 +8,9 @@ #include "base/memory/mru_cache.h" #include "base/sys_info.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/renderer_host/backing_store.h" #include "content/browser/renderer_host/render_widget_host.h" +#include "content/common/content_switches.h" #include "content/common/notification_service.h" namespace { diff --git a/content/browser/renderer_host/backing_store_win.cc b/content/browser/renderer_host/backing_store_win.cc index 49545d5..fc093e8 100644 --- a/content/browser/renderer_host/backing_store_win.cc +++ b/content/browser/renderer_host/backing_store_win.cc @@ -5,9 +5,9 @@ #include "content/browser/renderer_host/backing_store_win.h" #include "base/command_line.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_widget_host.h" +#include "content/common/content_switches.h" #include "skia/ext/platform_canvas.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/surface/transport_dib.h" diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc index 8416d4b..1f40576 100644 --- a/content/browser/renderer_host/browser_render_process_host.cc +++ b/content/browser/renderer_host/browser_render_process_host.cc @@ -28,7 +28,6 @@ #include "base/threading/thread_restrictions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "content/browser/appcache/appcache_dispatcher_host.h" #include "content/browser/browser_child_process_host.h" @@ -68,6 +67,7 @@ #include "content/browser/worker_host/worker_message_filter.h" #include "content/common/child_process_info.h" #include "content/common/child_process_messages.h" +#include "content/common/content_switches.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/notification_service.h" #include "content/common/process_watcher.h" @@ -512,14 +512,9 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { - switches::kAllowHTTPBackgroundPage, - switches::kAllowScriptingGallery, - switches::kAppsCheckoutURL, - switches::kAppsGalleryURL, // We propagate the Chrome Frame command line here as well in case the // renderer is not run in the sandbox. switches::kChromeFrame, - switches::kDebugPrint, switches::kDisable3DAPIs, switches::kDisableAcceleratedCompositing, switches::kDisableApplicationCache, @@ -538,49 +533,29 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kDisableJavaScriptI18NAPI, switches::kDisableLocalStorage, switches::kDisableLogging, -#if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) - // Enabled by default in Google Chrome builds, except on CrOS. - switches::kDisablePrintPreview, -#else - // Disabled by default in Chromium builds and on CrOS. - switches::kEnablePrintPreview, -#endif switches::kDisableSeccompSandbox, switches::kDisableSessionStorage, switches::kDisableSharedWorkers, switches::kDisableSpeechInput, switches::kDisableWebSockets, - switches::kDomAutomationController, - switches::kDumpHistogramsOnExit, switches::kEnableAdaptive, switches::kEnableBenchmarking, - switches::kEnableClickToPlay, - switches::kEnableCrxlessWebApps, switches::kEnableDCHECK, - switches::kEnableExperimentalExtensionApis, - switches::kEnableInBrowserThumbnailing, - switches::kEnableIPCFuzzing, switches::kEnableLogging, - switches::kEnableNaCl, switches::kEnableOpenMax, #if defined(ENABLE_P2P_APIS) switches::kEnableP2PApi, #endif switches::kEnablePepperTesting, - switches::kEnableRemoting, - switches::kEnableResourceContentSettings, #if defined(OS_MACOSX) // Allow this to be set when invoking the browser and relayed along. switches::kEnableSandboxLogging, #endif - switches::kEnableSearchProviderApiV2, switches::kEnableSeccompSandbox, switches::kEnableStatsTable, switches::kEnableVideoFullscreen, switches::kEnableVideoLogging, - switches::kEnableWatchdog, switches::kEnableWebAudio, - switches::kExperimentalSpellcheckerFeatures, switches::kFullMemoryCrashReport, #if !defined (GOOGLE_CHROME_BUILD) // These are unsupported and not fully tested modes, so don't enable them @@ -590,23 +565,13 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kInProcessWebGL, switches::kJavaScriptFlags, switches::kLoggingLevel, - switches::kMemoryProfiling, - switches::kMessageLoopHistogrammer, switches::kNoJsRandomness, switches::kNoReferrers, switches::kNoSandbox, switches::kPlaybackMode, - switches::kPpapiFlashArgs, - switches::kPpapiFlashInProcess, - switches::kPpapiFlashPath, - switches::kPpapiFlashVersion, switches::kPpapiOutOfProcess, - switches::kProfilingAtStart, - switches::kProfilingFile, - switches::kProfilingFlush, switches::kRecordMode, switches::kRegisterPepperPlugins, - switches::kRemoteShellPort, switches::kRendererAssertTest, #if !defined(OFFICIAL_BUILD) switches::kRendererCheckFalseTest, @@ -614,7 +579,6 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kRendererCrashTest, switches::kRendererStartupDialog, switches::kShowPaintRects, - switches::kSilentDumpOnDCHECK, switches::kSimpleDataSource, switches::kTestSandbox, // This flag needs to be propagated to the renderer process for diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 86a2af7..09b5df7 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -15,7 +15,6 @@ #include "chrome/browser/download/download_types.h" #include "chrome/browser/download/download_util.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" @@ -28,6 +27,7 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_widget_helper.h" #include "content/browser/user_metrics.h" +#include "content/common/content_switches.h" #include "content/common/desktop_notification_messages.h" #include "content/common/notification_service.h" #include "content/common/url_constants.h" diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index 360fab2..9804a66 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc @@ -6,10 +6,10 @@ #include "base/command_line.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_switches.h" #include "content/common/test_url_constants.h" RenderProcessHostTest::RenderProcessHostTest() { diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index 4ae3695..e3f7887 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -11,8 +11,6 @@ #include "base/message_loop.h" #include "base/metrics/histogram.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/accessibility/browser_accessibility_state.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/browser/renderer_host/backing_store.h" #include "content/browser/renderer_host/backing_store_manager.h" @@ -20,6 +18,7 @@ #include "content/browser/renderer_host/render_widget_helper.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/user_metrics.h" +#include "content/common/content_switches.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" @@ -95,8 +94,7 @@ RenderWidgetHost::RenderWidgetHost(RenderProcessHost* process, process_->WidgetRestored(); if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kForceRendererAccessibility) || - BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { + switches::kForceRendererAccessibility)) { EnableRendererAccessibility(); } } diff --git a/content/browser/speech/speech_input_browsertest.cc b/content/browser/speech/speech_input_browsertest.cc index 83ae2b4..b6dbb71 100644 --- a/content/browser/speech/speech_input_browsertest.cc +++ b/content/browser/speech/speech_input_browsertest.cc @@ -7,13 +7,13 @@ #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/speech/speech_input_dispatcher_host.h" #include "content/browser/speech/speech_input_manager.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_switches.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" namespace speech_input { diff --git a/content/browser/worker_host/worker_service.cc b/content/browser/worker_host/worker_service.cc index ce3ebac..a5477db 100644 --- a/content/browser/worker_host/worker_service.cc +++ b/content/browser/worker_host/worker_service.cc @@ -10,10 +10,10 @@ #include "base/logging.h" #include "base/sys_info.h" #include "base/threading/thread.h" -#include "chrome/common/chrome_switches.h" #include "content/browser/resource_context.h" #include "content/browser/worker_host/worker_message_filter.h" #include "content/browser/worker_host/worker_process_host.h" +#include "content/common/content_switches.h" #include "content/common/view_messages.h" #include "content/common/worker_messages.h" #include "net/base/registry_controlled_domain.h" diff --git a/content/browser/zygote_host_linux.cc b/content/browser/zygote_host_linux.cc index 0469a97..b3ab212 100644 --- a/content/browser/zygote_host_linux.cc +++ b/content/browser/zygote_host_linux.cc @@ -9,6 +9,7 @@ #include <sys/types.h> #include <unistd.h> +#include "base/base_switches.h" #include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/environment.h" @@ -22,8 +23,9 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" +#include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/render_sandbox_host_linux.h" +#include "content/common/content_switches.h" #include "content/common/process_watcher.h" #include "content/common/result_codes.h" #include "content/common/unix_domain_socket_posix.h" @@ -104,14 +106,8 @@ void ZygoteHost::Init(const std::string& sandbox_cmd) { switches::kAllowSandboxDebugging, switches::kLoggingLevel, switches::kEnableLogging, // Support, e.g., --enable-logging=stderr. - switches::kEnableRemoting, switches::kV, switches::kVModule, - switches::kUserDataDir, // Make logs go to the right file. - // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. - switches::kPpapiFlashInProcess, - switches::kPpapiFlashPath, - switches::kPpapiFlashVersion, switches::kRegisterPepperPlugins, switches::kDisableSeccompSandbox, switches::kEnableSeccompSandbox, @@ -119,6 +115,9 @@ void ZygoteHost::Init(const std::string& sandbox_cmd) { cmd_line.CopySwitchesFrom(browser_command_line, kForwardSwitches, arraysize(kForwardSwitches)); + content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( + &cmd_line, -1); + sandbox_binary_ = sandbox_cmd.c_str(); struct stat st; diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc index b01e2ed..8a30120 100644 --- a/content/browser/zygote_main_linux.cc +++ b/content/browser/zygote_main_linux.cc @@ -29,8 +29,8 @@ #include "build/build_config.h" #include "crypto/nss_util.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "content/common/chrome_descriptors.h" +#include "content/common/content_switches.h" #include "content/common/font_config_ipc_linux.h" #include "content/common/main_function_params.h" #include "content/common/pepper_plugin_registry.h" diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc index c27340f..b721c7f 100644 --- a/content/common/content_switches.cc +++ b/content/common/content_switches.cc @@ -30,9 +30,18 @@ const char kChromeFrame[] = "chrome-frame"; // support for controlling access to these APIs. const char kDisable3DAPIs[] = "disable-3d-apis"; +// Disable gpu-accelerated 2d canvas. +const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas"; + // Disables accelerated compositing. const char kDisableAcceleratedCompositing[] = "disable-accelerated-compositing"; +// Disables the hardware acceleration of 3D CSS and animation. +const char kDisableAcceleratedLayers[] = "disable-accelerated-layers"; + +// Disables GPU accelerated video display. +const char kDisableAcceleratedVideo[] = "disable-accelerated-video"; + // Disables the alternate window station for the renderer. const char kDisableAltWinstation[] = "disable-winsta"; @@ -77,6 +86,11 @@ const char kDisableGLSLTranslator[] = "disable-glsl-translator"; // Disable the GPU process sandbox. const char kDisableGpuSandbox[] = "disable-gpu-sandbox"; +// Suppresses hang monitor dialogs in renderer processes. This may allow slow +// unload handlers on a page to prevent the tab from closing, but the Task +// Manager can be used to terminate the offending process in this case. +const char kDisableHangMonitor[] = "disable-hang-monitor"; + // Disable the thread that crashes the GPU process if it stops responding to // messages. const char kDisableGpuWatchdog[] = "disable-gpu-watchdog"; @@ -106,6 +120,9 @@ const char kDisablePlugins[] = "disable-plugins"; // Disable pop-up blocking. const char kDisablePopupBlocking[] = "disable-popup-blocking"; +// Turns off the accessibility in the renderer. +const char kDisableRendererAccessibility[] = "disable-renderer-accessibility"; + // Disable the seccomp sandbox (Linux only) const char kDisableSeccompSandbox[] = "disable-seccomp-sandbox"; @@ -124,12 +141,18 @@ const char kDisableSpellcheckAPI[] = "disable-spellcheck-api"; // Disable Web Sockets support. const char kDisableWebSockets[] = "disable-web-sockets"; +// Enable gpu-accelerated 2d canvas. +const char kEnableAccelerated2dCanvas[] = "enable-accelerated-2d-canvas"; + // Enable hardware accelerated page drawing. // Please note that this flag is honored only if chromium is compiled with // SKIA_GPU flag, which can be enabled by setting use_skia_gpu variable to 1 // in build/features_override.gypi. const char kEnableAcceleratedDrawing[] = "enable-accelerated-drawing"; +// Enables the hardware acceleration of plugins. +const char kEnableAcceleratedPlugins[] = "enable-accelerated-plugins"; + // Enables WebKit accessibility within the renderer process. const char kEnableAccessibility[] = "enable-accessibility"; @@ -200,6 +223,11 @@ const char kExtensionProcess[] = "extension"; // current details. const char kForceFieldTestNameAndValue[] = "force-fieldtest"; +// Force renderer accessibility to be on instead of enabling it on demand when +// a screen reader is detected. The disable-renderer-accessibility switch +// overrides this if present. +const char kForceRendererAccessibility[] = "force-renderer-accessibility"; + // Extra command line options for launching the GPU process (normally used // for debugging). Use like renderer-cmd-prefix. const char kGpuLauncher[] = "gpu-launcher"; @@ -210,6 +238,9 @@ const char kGpuProcess[] = "gpu-process"; // Causes the GPU process to display a dialog on launch. const char kGpuStartupDialog[] = "gpu-startup-dialog"; +// Ignores GPU blacklist. +const char kIgnoreGpuBlacklist[] = "ignore-gpu-blacklist"; + // Run the GPU process as a thread in the browser process. const char kInProcessGPU[] = "in-process-gpu"; diff --git a/content/common/content_switches.h b/content/common/content_switches.h index 64adb1e..5696869 100644 --- a/content/common/content_switches.h +++ b/content/common/content_switches.h @@ -19,7 +19,10 @@ extern const char kBrowserSubprocessPath[]; // TODO(jam): this doesn't belong in content. extern const char kChromeFrame[]; extern const char kDisable3DAPIs[]; +extern const char kDisableAccelerated2dCanvas[]; extern const char kDisableAcceleratedCompositing[]; +extern const char kDisableAcceleratedLayers[]; +extern const char kDisableAcceleratedVideo[]; extern const char kDisableAltWinstation[]; extern const char kDisableApplicationCache[]; extern const char kDisableAudio[]; @@ -35,6 +38,7 @@ extern const char kDisableGLMultisampling[]; extern const char kDisableGLSLTranslator[]; extern const char kDisableGpuSandbox[]; extern const char kDisableGpuWatchdog[]; +extern const char kDisableHangMonitor[]; extern const char kDisableIndexedDatabase[]; extern const char kDisableJava[]; extern const char kDisableJavaScript[]; @@ -43,13 +47,16 @@ extern const char kDisableLocalStorage[]; extern const char kDisableLogging[]; extern const char kDisablePlugins[]; extern const char kDisablePopupBlocking[]; +extern const char kDisableRendererAccessibility[]; extern const char kDisableSeccompSandbox[]; extern const char kDisableSessionStorage[]; extern const char kDisableSharedWorkers[]; extern const char kDisableSpeechInput[]; extern const char kDisableSpellcheckAPI[]; extern const char kDisableWebSockets[]; +extern const char kEnableAccelerated2dCanvas[]; extern const char kEnableAcceleratedDrawing[]; +extern const char kEnableAcceleratedPlugins[]; extern const char kEnableAccessibility[]; extern const char kEnableBenchmarking[]; extern const char kEnableDeviceMotion[]; @@ -68,9 +75,11 @@ extern const char kExperimentalLocationFeatures[]; extern const char kExtensionProcess[]; extern const char kExtraPluginDir[]; extern const char kForceFieldTestNameAndValue[]; +extern const char kForceRendererAccessibility[]; extern const char kGpuLauncher[]; extern const char kGpuProcess[]; extern const char kGpuStartupDialog[]; +extern const char kIgnoreGpuBlacklist[]; extern const char kInProcessGPU[]; extern const char kInProcessPlugins[]; extern const char kInProcessWebGL[]; |
