| Index: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
|
| diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
|
| index d07ebfc9eefb6ba02c36c0edcf3ac918bef27624..1a6b9f70253321a5ea1b3cb54fc3247c896f0af8 100644
|
| --- a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
|
| +++ b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
|
| @@ -123,6 +123,20 @@ void ChromeWebViewGuestDelegate::OnEmbedderDestroyed() {
|
| web_view_guest()->view_instance_id()));
|
| }
|
|
|
| +void ChromeWebViewGuestDelegate::OnDidAttachToEmbedder() {
|
| + // TODO(fsamuel): This code should be implemented in GuestViewBase once the
|
| + // ZoomController moves to the extensions module.
|
| + ZoomController* zoom_controller = ZoomController::FromWebContents(
|
| + web_view_guest()->embedder_web_contents());
|
| + if (!zoom_controller)
|
| + return;
|
| + // Listen to the embedder's zoom changes.
|
| + zoom_controller->AddObserver(this);
|
| + // Set the guest's initial zoom level to be equal to the embedder's.
|
| + ZoomController::FromWebContents(guest_web_contents())->
|
| + SetZoomLevel(zoom_controller->GetZoomLevel());
|
| +}
|
| +
|
| void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame(
|
| bool is_main_frame) {
|
| // Update the current zoom factor for the new page.
|
| @@ -238,3 +252,9 @@ void ChromeWebViewGuestDelegate::OnAccessibilityStatusChanged(
|
| }
|
| }
|
| #endif
|
| +
|
| +void ChromeWebViewGuestDelegate::OnZoomChanged(
|
| + const ZoomController::ZoomChangedEventData& data) {
|
| + ZoomController::FromWebContents(guest_web_contents())->
|
| + SetZoomLevel(data.new_zoom_level);
|
| +}
|
|
|