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. | |
Charlie Reis
2015/05/22 23:44:30
Can you explain a little more about the case that'
lazyboy
2015/05/26 16:32:54
Done.
| |
565 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
566 switches::kSitePerProcess)) { | |
567 web_contents()->WasShown(); | |
568 } | |
561 } | 569 } |
562 | 570 |
563 void GuestViewBase::ActivateContents(WebContents* web_contents) { | 571 void GuestViewBase::ActivateContents(WebContents* web_contents) { |
564 if (!attached() || !embedder_web_contents()->GetDelegate()) | 572 if (!attached() || !embedder_web_contents()->GetDelegate()) |
565 return; | 573 return; |
566 | 574 |
567 embedder_web_contents()->GetDelegate()->ActivateContents( | 575 embedder_web_contents()->GetDelegate()->ActivateContents( |
568 embedder_web_contents()); | 576 embedder_web_contents()); |
569 } | 577 } |
570 | 578 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 | 831 |
824 auto embedder_zoom_controller = | 832 auto embedder_zoom_controller = |
825 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); | 833 ui_zoom::ZoomController::FromWebContents(owner_web_contents()); |
826 // Chrome Apps do not have a ZoomController. | 834 // Chrome Apps do not have a ZoomController. |
827 if (!embedder_zoom_controller) | 835 if (!embedder_zoom_controller) |
828 return; | 836 return; |
829 embedder_zoom_controller->RemoveObserver(this); | 837 embedder_zoom_controller->RemoveObserver(this); |
830 } | 838 } |
831 | 839 |
832 } // namespace guest_view | 840 } // namespace guest_view |
OLD | NEW |