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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 916363003: Enable pinch-zoom on the new login page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: extensions/browser/guest_view/web_view/web_view_guest.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index 9e60bfddef4d22bf074249c6b43c9b6dcf436630..2b746874b99a1d8af33a29e654859876f70e8d82 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -443,6 +443,12 @@ void WebViewGuest::HandleKeyboardEvent(
GuestViewBase::HandleKeyboardEvent(source, event);
}
+bool WebViewGuest::PreHandleGestureEvent(content::WebContents* source,
+ const blink::WebGestureEvent& event) {
+ return allow_scaling_ ? false
Fady Samuel 2015/02/12 21:27:09 return !allow_scaling_ && GuestViewBase::PreHandle
wjmaclean 2015/02/12 21:41:25 Done.
+ : GuestViewBase::PreHandleGestureEvent(source, event);
+}
+
void WebViewGuest::LoadProgressChanged(content::WebContents* source,
double progress) {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
@@ -638,6 +644,7 @@ WebViewGuest::WebViewGuest(content::WebContents* owner_web_contents)
guest_opaque_(true),
javascript_dialog_helper_(this),
current_zoom_factor_(1.0),
+ allow_scaling_(false),
weak_ptr_factory_(this) {
web_view_guest_delegate_.reset(
ExtensionsAPIClient::Get()->CreateWebViewGuestDelegate(this));
@@ -966,6 +973,10 @@ void WebViewGuest::ApplyAttributes(const base::DictionaryValue& params) {
// there is a RenderWidgetHostView available.
SetAllowTransparency(allow_transparency);
+ bool allow_scaling = false;
+ params.GetBoolean(webview::kAttributeAllowScaling, &allow_scaling);
+ SetAllowScaling(allow_scaling);
+
bool is_pending_new_window = false;
if (GetOpener()) {
// We need to do a navigation here if the target URL has changed between
@@ -1044,6 +1055,10 @@ void WebViewGuest::SetAllowTransparency(bool allow) {
}
}
+void WebViewGuest::SetAllowScaling(bool allow) {
+ allow_scaling_ = allow;
+}
+
bool WebViewGuest::LoadDataWithBaseURL(const std::string& data_url,
const std::string& base_url,
const std::string& virtual_url,

Powered by Google App Engine
This is Rietveld 408576698