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

Unified Diff: content/renderer/render_view.cc

Issue 7764006: Enable Fixed Layout Mode on TOUCH_UI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated according to discussion with jam Created 9 years, 4 months 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 | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 1b63862e5ae515a31fab6b863ac63b33d81709d1..7cf3bb6b1e6f0530894d284ab579bd646d26ad27 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -262,6 +262,10 @@ static const int kDelaySecondsForContentStateSync = 1;
// The maximum number of popups that can be spawned from one page.
static const int kMaximumNumberOfUnacknowledgedPopups = 25;
+// The default layout width and height for pages when fixed layout is enabled.
+static const int kDefaultLayoutWidth = 980;
+static const int kDefaultLayoutHeight = 640;
+
static const float kScalingIncrement = 0.1f;
static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) {
@@ -1226,6 +1230,17 @@ void RenderView::UpdateURL(WebFrame* frame) {
accessibility_.reset();
pending_accessibility_notifications_.clear();
}
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kEnableFixedLayout)) {
+ // Only enable fixed layout for normal web content.
+ GURL frame_url = GURL(request.url());
+ if (frame_url.SchemeIs(chrome::kHttpScheme) ||
+ frame_url.SchemeIs(chrome::kHttpsScheme)) {
+ webview()->enableFixedLayoutMode(true);
+ webview()->setFixedLayoutSize(
+ WebSize(kDefaultLayoutWidth, kDefaultLayoutHeight));
+ }
+ }
}
// Tell the embedding application that the title of the active page has changed
@@ -1438,6 +1453,10 @@ WebExternalPopupMenu* RenderView::createExternalPopupMenu(
return external_popup_menu_.get();
}
+WebRect RenderView::getDeviceRect() const {
+ return WebRect(0, 0, size().width(), size().height());
+}
+
RenderWidgetFullscreenPepper* RenderView::CreatePepperFullscreenContainer(
webkit::ppapi::PluginInstance* plugin) {
GURL active_url;
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698