Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2487)

Unified Diff: chrome/browser/ui/webui/chrome_web_ui.cc

Issue 8695007: Replace TOUCH_UI condition in WebUI with dynamic flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tiny tweaks based on CR feedback Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui.h ('k') | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chrome_web_ui.cc
diff --git a/chrome/browser/ui/webui/chrome_web_ui.cc b/chrome/browser/ui/webui/chrome_web_ui.cc
index ea37886c665337f5ce1602400932a6d8d70e6a9e..466309889b088bce8eeb93844b6d6913acdda2be 100644
--- a/chrome/browser/ui/webui/chrome_web_ui.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
+#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#if defined(TOOLKIT_VIEWS)
@@ -35,6 +36,17 @@ bool ChromeWebUI::CanShowBookmarkBar() const {
return false;
}
+void ChromeWebUI::RenderViewCreated(RenderViewHost* render_view_host) {
+ WebUI::RenderViewCreated(render_view_host);
+
+ // 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))
+ render_view_host->SetWebUIProperty("touchOptimized", "true");
+}
+
// static
bool ChromeWebUI::IsMoreWebUI() {
bool more_webui = CommandLine::ForCurrentProcess()->HasSwitch(
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui.h ('k') | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698