Commit 6e1e1922 authored by fsamuel@chromium.org's avatar fsamuel@chromium.org

Enable Fixed Layout Mode on TOUCH_UI.

BUG=none
TEST=manually


Review URL: http://codereview.chromium.org/7764006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98716 0039d316-1c4b-4281-b951-d872f2087c98
parent a179fac7
...@@ -262,6 +262,10 @@ static const int kDelaySecondsForContentStateSync = 1; ...@@ -262,6 +262,10 @@ static const int kDelaySecondsForContentStateSync = 1;
// The maximum number of popups that can be spawned from one page. // The maximum number of popups that can be spawned from one page.
static const int kMaximumNumberOfUnacknowledgedPopups = 25; 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 float kScalingIncrement = 0.1f;
static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) { static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) {
...@@ -1228,6 +1232,16 @@ void RenderView::UpdateURL(WebFrame* frame) { ...@@ -1228,6 +1232,16 @@ void RenderView::UpdateURL(WebFrame* frame) {
accessibility_.reset(); accessibility_.reset();
pending_accessibility_notifications_.clear(); 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(chrome::kHttpScheme) ||
frame_url.SchemeIs(chrome::kHttpsScheme)) {
webview()->enableFixedLayoutMode(true);
webview()->setFixedLayoutSize(
WebSize(kDefaultLayoutWidth, kDefaultLayoutHeight));
}
#endif
} }
// Tell the embedding application that the title of the active page has changed // Tell the embedding application that the title of the active page has changed
...@@ -1440,6 +1454,12 @@ WebExternalPopupMenu* RenderView::createExternalPopupMenu( ...@@ -1440,6 +1454,12 @@ WebExternalPopupMenu* RenderView::createExternalPopupMenu(
return external_popup_menu_.get(); 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( RenderWidgetFullscreenPepper* RenderView::CreatePepperFullscreenContainer(
webkit::ppapi::PluginInstance* plugin) { webkit::ppapi::PluginInstance* plugin) {
GURL active_url; GURL active_url;
......
...@@ -150,6 +150,7 @@ struct WebFindOptions; ...@@ -150,6 +150,7 @@ struct WebFindOptions;
struct WebMediaPlayerAction; struct WebMediaPlayerAction;
struct WebPluginParams; struct WebPluginParams;
struct WebPoint; struct WebPoint;
struct WebRect;
struct WebWindowFeatures; struct WebWindowFeatures;
} }
...@@ -371,6 +372,9 @@ class RenderView : public RenderWidget, ...@@ -371,6 +372,9 @@ class RenderView : public RenderWidget,
virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu( virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
const WebKit::WebPopupMenuInfo& popup_menu_info, const WebKit::WebPopupMenuInfo& popup_menu_info,
WebKit::WebExternalPopupMenuClient* popup_menu_client); WebKit::WebExternalPopupMenuClient* popup_menu_client);
#if defined(TOUCH_UI)
virtual WebKit::WebRect getDeviceRect() const;
#endif
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace( virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
unsigned quota); unsigned quota);
virtual void didAddMessageToConsole( virtual void didAddMessageToConsole(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment