From aa75e4edab3f660c70f546f14a170ac96071a0ad Mon Sep 17 00:00:00 2001 From: "dbeam@chromium.org" Date: Thu, 8 Nov 2012 23:51:51 +0000 Subject: Add a runtime flag for interactive autocomplete (and trigger the necessary features in WebKit to support this). BUG=157661 TBR=thakis@chromium.org Review URL: https://chromiumcodereview.appspot.com/11366127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166809 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/generated_resources.grd | 7 +++++++ chrome/browser/about_flags.cc | 7 +++++++ chrome/browser/chrome_content_browser_client.cc | 1 + chrome/common/chrome_switches.cc | 5 +++++ chrome/common/chrome_switches.h | 1 + chrome/renderer/chrome_render_process_observer.cc | 6 ++++++ 6 files changed, 27 insertions(+) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ad2feaf..3b1ffa04 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6317,6 +6317,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Enable new Autofill heuristics. This primarily covers detection of additional field types, such as credit card type. + + Enable interactive autocomplete + + + Enable an interactive autocomplete UI that can be invoked by calling HTMLFormElement#requestAutocomplete. + Enable experimental form filling @@ -6833,6 +6839,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Enable passive gathering of performance-related metrics and events and provide the option to view this data in a graphical fashion. + Crashes diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index cddabae..584b840 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1099,6 +1099,13 @@ const Experiment kExperiments[] = { kOsWin | kOsCrOS, SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling) }, + { + "enable-interactive-autocomplete", + IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME, + IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION, + kOsWin | kOsCrOS, + SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete) + }, }; const Experiment* experiments = kExperiments; diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 000da0d..e123ba5 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -945,6 +945,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( switches::kEnableCrxlessWebApps, switches::kEnableExperimentalExtensionApis, switches::kEnableIPCFuzzing, + switches::kEnableInteractiveAutocomplete, switches::kEnableNaCl, switches::kEnableNaClSRPCProxy, switches::kEnablePasswordGeneration, diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index e0e5a1c..f5f8c8a 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -488,6 +488,11 @@ const char kEnableDevToolsExperiments[] = "enable-devtools-experiments"; // Enables Drive v2 API instead of Google Documents List API. const char kEnableDriveV2Api[] = "enable-drive-v2-api"; +// Enables an interactive autocomplete UI and a way to invoke this UI from +// WebKit by enabling HTMLFormElement#requestAutocomplete (and associated +// autocomplete* events and logic). +const char kEnableInteractiveAutocomplete[] = "enable-interactive-autocomplete"; + // Enables extensions to be easily installed from sites other than the web // store. Without this flag, they can still be installed, but must be manually // dragged onto chrome://extensions/. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 2c059ce..170f392 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -152,6 +152,7 @@ extern const char kEnableExtensionTimelineApi[]; extern const char kEnableFileCookies[]; extern const char kEnableHttpPipelining[]; extern const char kEnableInstantExtendedAPI[]; +extern const char kEnableInteractiveAutocomplete[]; extern const char kEnableIPCFuzzing[]; extern const char kEnableIPPooling[]; extern const char kEnableIPv6[]; diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc index 3e03c3f..9b84e40 100644 --- a/chrome/renderer/chrome_render_process_observer.cc +++ b/chrome/renderer/chrome_render_process_observer.cc @@ -166,6 +166,12 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver( base::StatisticsRecorder::set_dump_on_exit(true); } +#if defined(TOOLKIT_VIEWS) + WebRuntimeFeatures::enableRequestAutocomplete( + command_line.HasSwitch(switches::kEnableInteractiveAutocomplete) || + command_line.HasSwitch(switches::kEnableExperimentalWebKitFeatures)); +#endif + RenderThread* thread = RenderThread::Get(); resource_delegate_.reset(new RendererResourceDelegate()); thread->SetResourceDispatcherDelegate(resource_delegate_.get()); -- cgit v1.1