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

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

Issue 2204393002: [Extensions] Remove ExtensionFunction usage of RenderViewHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5424db93d4ef0a12ae8b425dc82d1411fab5d169..00f6c6a709dbe00c91b5af0a775ac0d5fa755d95 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -441,6 +441,12 @@ void WebViewGuest::EmbedderFullscreenToggled(bool entered_fullscreen) {
SetFullscreenState(false);
}
+bool WebViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
+ // We use the embedder's zoom iff we haven't set a zoom ourselves using
+ // e.g. webview.setZoom().
+ return !did_set_explicit_zoom_;
+}
+
const char* WebViewGuest::GetAPINamespace() const {
return webview::kAPINamespace;
}
@@ -781,6 +787,7 @@ WebViewGuest::WebViewGuest(WebContents* owner_web_contents)
is_embedder_fullscreen_(false),
last_fullscreen_permission_was_allowed_by_embedder_(false),
pending_zoom_factor_(0.0),
+ did_set_explicit_zoom_(false),
weak_ptr_factory_(this) {
web_view_guest_delegate_.reset(
ExtensionsAPIClient::Get()->CreateWebViewGuestDelegate(this));
@@ -1155,6 +1162,7 @@ void WebViewGuest::SetName(const std::string& name) {
}
void WebViewGuest::SetZoom(double zoom_factor) {
+ did_set_explicit_zoom_ = true;
auto* zoom_controller = ZoomController::FromWebContents(web_contents());
DCHECK(zoom_controller);
double zoom_level = content::ZoomFactorToZoomLevel(zoom_factor);
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698