Chromium Code Reviews| Index: content/renderer/render_view.cc |
| diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc |
| index a6e16c8f23dad020b855f0c38d7bf0a4b96bf615..7a8c355de44d979c80e4f1012792fc189597ee36 100644 |
| --- a/content/renderer/render_view.cc |
| +++ b/content/renderer/render_view.cc |
| @@ -262,8 +262,14 @@ 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 const char* kHTTPScheme = "http"; |
|
jam
2011/08/29 19:14:46
this is already defined in content\common\url_cons
|
| + |
| static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) { |
| WebVector<WebURL> urls; |
| ds->redirectChain(urls); |
| @@ -1228,6 +1234,15 @@ void RenderView::UpdateURL(WebFrame* frame) { |
| accessibility_.reset(); |
| pending_accessibility_notifications_.clear(); |
| } |
| +#if defined(TOUCH_UI) |
| + // Only enable fixed layout for normal web content. |
| + GURL frame_url = GURL(request.url()); |
| + if (frame_url.SchemeIs(kHTTPScheme) || frame_url.SchemeIsSecure()) { |
| + webview()->enableFixedLayoutMode(true); |
| + webview()->setFixedLayoutSize( |
| + WebSize(kDefaultLayoutWidth, kDefaultLayoutHeight)); |
| + } |
| +#endif |
| } |
| // Tell the embedding application that the title of the active page has changed |
| @@ -1440,6 +1455,12 @@ WebExternalPopupMenu* RenderView::createExternalPopupMenu( |
| return external_popup_menu_.get(); |
| } |
| +#if defined(TOUCH_UI) |
| +WebRect RenderView::getDeviceRect() const { |
| + return WebRect(0, 0, size().width(), size().height()); |
| +} |
| +#endif |
| + |
| RenderWidgetFullscreenPepper* RenderView::CreatePepperFullscreenContainer( |
| webkit::ppapi::PluginInstance* plugin) { |
| GURL active_url; |