| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/guest_view/browser/guest_view_base.h" | 5 #include "components/guest_view/browser/guest_view_base.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/guest_view/browser/guest_view_event.h" | 9 #include "components/guest_view/browser/guest_view_event.h" |
| 10 #include "components/guest_view/browser/guest_view_manager.h" | 10 #include "components/guest_view/browser/guest_view_manager.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 delete this; | 553 delete this; |
| 554 } | 554 } |
| 555 | 555 |
| 556 void GuestViewBase::DidNavigateMainFrame( | 556 void GuestViewBase::DidNavigateMainFrame( |
| 557 const content::LoadCommittedDetails& details, | 557 const content::LoadCommittedDetails& details, |
| 558 const content::FrameNavigateParams& params) { | 558 const content::FrameNavigateParams& params) { |
| 559 if (attached() && ZoomPropagatesFromEmbedderToGuest()) | 559 if (attached() && ZoomPropagatesFromEmbedderToGuest()) |
| 560 SetGuestZoomLevelToMatchEmbedder(); | 560 SetGuestZoomLevelToMatchEmbedder(); |
| 561 } | 561 } |
| 562 | 562 |
| 563 void GuestViewBase::ActivateContents(WebContents* web_contents) { | 563 void GuestViewBase::ActivateContents(WebContents* web_contents, |
| 564 bool user_gesture) { |
| 564 if (!attached() || !embedder_web_contents()->GetDelegate()) | 565 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 565 return; | 566 return; |
| 566 | 567 |
| 567 embedder_web_contents()->GetDelegate()->ActivateContents( | 568 embedder_web_contents()->GetDelegate()->ActivateContents( |
| 568 embedder_web_contents()); | 569 embedder_web_contents(), user_gesture); |
| 569 } | 570 } |
| 570 | 571 |
| 571 void GuestViewBase::DeactivateContents(WebContents* web_contents) { | 572 void GuestViewBase::DeactivateContents(WebContents* web_contents) { |
| 572 if (!attached() || !embedder_web_contents()->GetDelegate()) | 573 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 573 return; | 574 return; |
| 574 | 575 |
| 575 embedder_web_contents()->GetDelegate()->DeactivateContents( | 576 embedder_web_contents()->GetDelegate()->DeactivateContents( |
| 576 embedder_web_contents()); | 577 embedder_web_contents()); |
| 577 } | 578 } |
| 578 | 579 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 | 824 |
| 824 auto embedder_zoom_controller = | 825 auto embedder_zoom_controller = |
| 825 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); | 826 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); |
| 826 // Chrome Apps do not have a ZoomController. | 827 // Chrome Apps do not have a ZoomController. |
| 827 if (!embedder_zoom_controller) | 828 if (!embedder_zoom_controller) |
| 828 return; | 829 return; |
| 829 embedder_zoom_controller->RemoveObserver(this); | 830 embedder_zoom_controller->RemoveObserver(this); |
| 830 } | 831 } |
| 831 | 832 |
| 832 } // namespace guest_view | 833 } // namespace guest_view |
| OLD | NEW |