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" | |
7 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "components/guest_view/browser/guest_view_event.h" | 10 #include "components/guest_view/browser/guest_view_event.h" |
10 #include "components/guest_view/browser/guest_view_manager.h" | 11 #include "components/guest_view/browser/guest_view_manager.h" |
11 #include "components/guest_view/common/guest_view_constants.h" | 12 #include "components/guest_view/common/guest_view_constants.h" |
12 #include "components/guest_view/common/guest_view_messages.h" | 13 #include "components/guest_view/common/guest_view_messages.h" |
13 #include "components/ui/zoom/page_zoom.h" | 14 #include "components/ui/zoom/page_zoom.h" |
14 #include "components/ui/zoom/zoom_controller.h" | 15 #include "components/ui/zoom/zoom_controller.h" |
15 #include "content/public/browser/navigation_details.h" | 16 #include "content/public/browser/navigation_details.h" |
16 #include "content/public/browser/render_frame_host.h" | 17 #include "content/public/browser/render_frame_host.h" |
17 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
18 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
19 #include "content/public/browser/render_widget_host_view.h" | 20 #include "content/public/browser/render_widget_host_view.h" |
20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/common/content_switches.h" | |
21 #include "content/public/common/page_zoom.h" | 23 #include "content/public/common/page_zoom.h" |
22 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
23 #include "third_party/WebKit/public/web/WebInputEvent.h" | 25 #include "third_party/WebKit/public/web/WebInputEvent.h" |
24 | 26 |
25 using content::WebContents; | 27 using content::WebContents; |
26 | 28 |
27 namespace content { | 29 namespace content { |
28 struct FrameNavigateParams; | 30 struct FrameNavigateParams; |
29 } | 31 } |
30 | 32 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 | 553 |
552 // Self-destruct. | 554 // Self-destruct. |
553 delete this; | 555 delete this; |
554 } | 556 } |
555 | 557 |
556 void GuestViewBase::DidNavigateMainFrame( | 558 void GuestViewBase::DidNavigateMainFrame( |
557 const content::LoadCommittedDetails& details, | 559 const content::LoadCommittedDetails& details, |
558 const content::FrameNavigateParams& params) { | 560 const content::FrameNavigateParams& params) { |
559 if (attached() && ZoomPropagatesFromEmbedderToGuest()) | 561 if (attached() && ZoomPropagatesFromEmbedderToGuest()) |
560 SetGuestZoomLevelToMatchEmbedder(); | 562 SetGuestZoomLevelToMatchEmbedder(); |
563 | |
564 // TODO(lazyboy): This breaks guest visibility in --site-per-process because | |
565 // we do not take the widget's visibility into account. We need to also | |
566 // stay hidden during "visibility:none" state. | |
Fady Samuel
2015/06/11 22:27:21
Does OOPIF have visibility implemented yet?
| |
567 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
568 switches::kSitePerProcess)) { | |
569 web_contents()->WasShown(); | |
570 } | |
561 } | 571 } |
562 | 572 |
563 void GuestViewBase::ActivateContents(WebContents* web_contents) { | 573 void GuestViewBase::ActivateContents(WebContents* web_contents) { |
564 if (!attached() || !embedder_web_contents()->GetDelegate()) | 574 if (!attached() || !embedder_web_contents()->GetDelegate()) |
565 return; | 575 return; |
566 | 576 |
567 embedder_web_contents()->GetDelegate()->ActivateContents( | 577 embedder_web_contents()->GetDelegate()->ActivateContents( |
568 embedder_web_contents()); | 578 embedder_web_contents()); |
569 } | 579 } |
570 | 580 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 | 833 |
824 auto embedder_zoom_controller = | 834 auto embedder_zoom_controller = |
825 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); | 835 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); |
826 // Chrome Apps do not have a ZoomController. | 836 // Chrome Apps do not have a ZoomController. |
827 if (!embedder_zoom_controller) | 837 if (!embedder_zoom_controller) |
828 return; | 838 return; |
829 embedder_zoom_controller->RemoveObserver(this); | 839 embedder_zoom_controller->RemoveObserver(this); |
830 } | 840 } |
831 | 841 |
832 } // namespace guest_view | 842 } // namespace guest_view |
OLD | NEW |