diff options
author | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-14 20:28:06 +0000 |
---|---|---|
committer | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-14 20:28:06 +0000 |
commit | 347a0c74816b8cea5e595e39dca62dd037b2d686 (patch) | |
tree | c5289c11c8290696acb094bb98714c7a9b8a4a3d /content/browser/webui | |
parent | aa26d4b3674c55cb189dc8081acdd1fbd272f4fe (diff) | |
download | chromium_src-347a0c74816b8cea5e595e39dca62dd037b2d686.zip chromium_src-347a0c74816b8cea5e595e39dca62dd037b2d686.tar.gz chromium_src-347a0c74816b8cea5e595e39dca62dd037b2d686.tar.bz2 |
Make touch-optimized-ui a tri-state flag
By default ('auto') touch-optimized-UI will be enabled if any touch screen is present. The user can also manually disable or enable it ('disabled', 'enabled') for testing purposes.
Note that for now --enable-touch-events is still required to enable the use of touch screens (and hence impact 'auto' here) since it's still experimental.
Also cleans up all the different ways we were trying to read this mode, unifying on ui::GetDisplayLayout().
BUG=124199
TBR=estade@chromium.org (only change in resources is trivial comment change)
TEST=
Review URL: https://chromiumcodereview.appspot.com/10391035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/webui')
-rw-r--r-- | content/browser/webui/web_ui_impl.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc index 455f038..43f8086 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc @@ -4,7 +4,6 @@ #include "content/browser/webui/web_ui_impl.h" -#include "base/command_line.h" #include "base/json/json_writer.h" #include "base/stl_util.h" #include "base/utf_string_conversions.h" @@ -18,7 +17,7 @@ #include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_message_handler.h" #include "content/public/common/bindings_policy.h" -#include "ui/base/ui_base_switches.h" +#include "ui/base/layout.h" using content::RenderViewHostImpl; using content::WebContents; @@ -102,11 +101,10 @@ void WebUIImpl::RenderViewCreated(content::RenderViewHost* render_view_host) { render_view_host->SetWebUIProperty("toolkit", "GTK"); #endif // defined(TOOLKIT_VIEWS) - // Let the WebUI know that we're looking for UI that's optimized for touch - // input. - // TODO(rbyers) Figure out the right model for enabling touch-optimized UI - // (http://crbug.com/105380). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTouchOptimizedUI)) + // Let the WebUI know if we're looking for UI that's optimized for touch + // input. Note that ideally we'd expose an API through the web platform + // indicating this information and use that instead. See crbug.com/123692. + if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) render_view_host->SetWebUIProperty("touchOptimized", "true"); } |