summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 23:51:51 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 23:51:51 +0000
commitaa75e4edab3f660c70f546f14a170ac96071a0ad (patch)
treeb64a665a1ae4613f5071d05bc180eeca02e7c38a
parentce1f8b101fb997a7efe577bbe3c29f239fa01db4 (diff)
downloadchromium_src-aa75e4edab3f660c70f546f14a170ac96071a0ad.zip
chromium_src-aa75e4edab3f660c70f546f14a170ac96071a0ad.tar.gz
chromium_src-aa75e4edab3f660c70f546f14a170ac96071a0ad.tar.bz2
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
-rw-r--r--chrome/app/generated_resources.grd7
-rw-r--r--chrome/browser/about_flags.cc7
-rw-r--r--chrome/browser/chrome_content_browser_client.cc1
-rw-r--r--chrome/common/chrome_switches.cc5
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/chrome_render_process_observer.cc6
6 files changed, 27 insertions, 0 deletions
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
<message name="IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION" desc="Description for the flag to enable new Autofill heuristics">
Enable new Autofill heuristics. This primarily covers detection of additional field types, such as credit card type.
</message>
+ <message name="IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME" desc="Name of the flag that enables an interactive autocomplete UI.">
+ Enable interactive autocomplete
+ </message>
+ <message name="IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION" desc="Description of the flag to enable an interactive autocomplete UI.">
+ Enable an interactive autocomplete UI that can be invoked by calling HTMLFormElement#requestAutocomplete.
+ </message>
<message name="IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME" desc="Title for the flag to enable experimental form filling">
Enable experimental form filling
</message>
@@ -6833,6 +6839,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION" desc="Description for the flag to enable Performance Monitor.">
Enable passive gathering of performance-related metrics and events and provide the option to view this data in a graphical fashion.
</message>
+
<!-- Crashes -->
<message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page.">
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());