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

Unified Diff: extensions/browser/guest_view/guest_view_base.h

Issue 787813004: Move ZoomController out of ChromeWebViewGuestDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix incorrect wording in comment. Created 6 years 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/guest_view_base.h
diff --git a/extensions/browser/guest_view/guest_view_base.h b/extensions/browser/guest_view/guest_view_base.h
index 7ca24dcc0ff8e995d034fad115ef8fa3041856eb..eecaa60fdb64f684e424462388b4ad824d18cb36 100644
--- a/extensions/browser/guest_view/guest_view_base.h
+++ b/extensions/browser/guest_view/guest_view_base.h
@@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "base/values.h"
+#include "components/ui/zoom/zoom_observer.h"
#include "content/public/browser/browser_plugin_guest_delegate.h"
#include "content/public/browser/render_process_host_observer.h"
#include "content/public/browser/web_contents.h"
@@ -28,7 +29,8 @@ namespace extensions {
// it is attached to a container within the owner's WebContents.
class GuestViewBase : public content::BrowserPluginGuestDelegate,
public content::WebContentsDelegate,
- public content::WebContentsObserver {
+ public content::WebContentsObserver,
+ public ui_zoom::ZoomObserver {
public:
class Event {
public:
@@ -246,6 +248,10 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
int browser_plugin_instance_id,
bool is_full_page_plugin) final;
+ // ui_zoom::ZoomObserver implementation.
+ void OnZoomChanged(
+ const ui_zoom::ZoomController::ZoomChangedEventData& data) override;
+
// Dispatches an event |event_name| to the embedder with the |event| fields.
void DispatchEventToEmbedder(Event* event);
@@ -267,6 +273,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
const WebContentsCreatedCallback& callback,
content::WebContents* guest_web_contents);
+ void StartObservingOwnersZoomController();
+ void StopObservingOwnersZoomControllerIfNecessary();
+
static void RegisterGuestViewTypes();
// WebContentsObserver implementation.
@@ -352,6 +361,8 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
// Whether the guest view is inside a plugin document.
bool is_full_page_plugin_;
+ bool observing_owners_zoom_controller_;
+
// This is used to ensure pending tasks will not fire after this object is
// destroyed.
base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
« no previous file with comments | « extensions/browser/api/web_view/web_view_internal_api.cc ('k') | extensions/browser/guest_view/guest_view_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698