| 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/command_line.h" | |
| 8 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/guest_view/browser/guest_view_event.h" | 9 #include "components/guest_view/browser/guest_view_event.h" |
| 11 #include "components/guest_view/browser/guest_view_manager.h" | 10 #include "components/guest_view/browser/guest_view_manager.h" |
| 12 #include "components/guest_view/common/guest_view_constants.h" | 11 #include "components/guest_view/common/guest_view_constants.h" |
| 13 #include "components/guest_view/common/guest_view_messages.h" | 12 #include "components/guest_view/common/guest_view_messages.h" |
| 14 #include "components/ui/zoom/page_zoom.h" | 13 #include "components/ui/zoom/page_zoom.h" |
| 15 #include "components/ui/zoom/zoom_controller.h" | 14 #include "components/ui/zoom/zoom_controller.h" |
| 16 #include "content/public/browser/navigation_details.h" | 15 #include "content/public/browser/navigation_details.h" |
| 17 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
| 18 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/browser/render_widget_host_view.h" | 19 #include "content/public/browser/render_widget_host_view.h" |
| 21 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/common/content_switches.h" | |
| 23 #include "content/public/common/page_zoom.h" | 21 #include "content/public/common/page_zoom.h" |
| 22 #include "content/public/common/site_isolation_policy.h" |
| 24 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 25 #include "third_party/WebKit/public/web/WebInputEvent.h" | 24 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 26 | 25 |
| 27 using content::WebContents; | 26 using content::WebContents; |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 struct FrameNavigateParams; | 29 struct FrameNavigateParams; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace guest_view { | 32 namespace guest_view { |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 563 |
| 565 void GuestViewBase::DidNavigateMainFrame( | 564 void GuestViewBase::DidNavigateMainFrame( |
| 566 const content::LoadCommittedDetails& details, | 565 const content::LoadCommittedDetails& details, |
| 567 const content::FrameNavigateParams& params) { | 566 const content::FrameNavigateParams& params) { |
| 568 if (attached() && ZoomPropagatesFromEmbedderToGuest()) | 567 if (attached() && ZoomPropagatesFromEmbedderToGuest()) |
| 569 SetGuestZoomLevelToMatchEmbedder(); | 568 SetGuestZoomLevelToMatchEmbedder(); |
| 570 | 569 |
| 571 // TODO(lazyboy): This breaks guest visibility in --site-per-process because | 570 // TODO(lazyboy): This breaks guest visibility in --site-per-process because |
| 572 // we do not take the widget's visibility into account. We need to also | 571 // we do not take the widget's visibility into account. We need to also |
| 573 // stay hidden during "visibility:none" state. | 572 // stay hidden during "visibility:none" state. |
| 574 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 573 if (content::SiteIsolationPolicy::GuestsShouldUseCrossProcessFrames()) { |
| 575 switches::kSitePerProcess)) { | |
| 576 web_contents()->WasShown(); | 574 web_contents()->WasShown(); |
| 577 } | 575 } |
| 578 } | 576 } |
| 579 | 577 |
| 580 void GuestViewBase::ActivateContents(WebContents* web_contents) { | 578 void GuestViewBase::ActivateContents(WebContents* web_contents) { |
| 581 if (!attached() || !embedder_web_contents()->GetDelegate()) | 579 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 582 return; | 580 return; |
| 583 | 581 |
| 584 embedder_web_contents()->GetDelegate()->ActivateContents( | 582 embedder_web_contents()->GetDelegate()->ActivateContents( |
| 585 embedder_web_contents()); | 583 embedder_web_contents()); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 838 |
| 841 auto embedder_zoom_controller = | 839 auto embedder_zoom_controller = |
| 842 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); | 840 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); |
| 843 // Chrome Apps do not have a ZoomController. | 841 // Chrome Apps do not have a ZoomController. |
| 844 if (!embedder_zoom_controller) | 842 if (!embedder_zoom_controller) |
| 845 return; | 843 return; |
| 846 embedder_zoom_controller->RemoveObserver(this); | 844 embedder_zoom_controller->RemoveObserver(this); |
| 847 } | 845 } |
| 848 | 846 |
| 849 } // namespace guest_view | 847 } // namespace guest_view |
| OLD | NEW |