OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 // BrowserPluginGuest::SetFocus() | 566 // BrowserPluginGuest::SetFocus() |
567 // content::InterstitialPageImpl::Hide() | 567 // content::InterstitialPageImpl::Hide() |
568 // content::InterstitialPageImpl::DontProceed(). | 568 // content::InterstitialPageImpl::DontProceed(). |
569 // | 569 // |
570 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. | 570 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. |
571 return; | 571 return; |
572 } | 572 } |
573 | 573 |
574 guest_rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, | 574 guest_rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, |
575 last_can_compose_inline_, last_input_flags_); | 575 last_can_compose_inline_, last_input_flags_); |
576 // Enable input method for guest if it's enabled for the embedder. | |
577 if (!static_cast<RenderViewHostImpl*>( | |
578 owner_web_contents_->GetRenderViewHost())->input_method_active()) { | |
579 return; | |
580 } | |
581 RenderViewHostImpl* guest_rvh = | |
582 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()); | |
583 guest_rvh->SetInputMethodActive(true); | |
584 } | 576 } |
585 | 577 |
586 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( | 578 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( |
587 RenderFrameHost* render_frame_host, | 579 RenderFrameHost* render_frame_host, |
588 const GURL& url, | 580 const GURL& url, |
589 ui::PageTransition transition_type) { | 581 ui::PageTransition transition_type) { |
590 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 582 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
591 } | 583 } |
592 | 584 |
593 void BrowserPluginGuest::RenderViewReady() { | 585 void BrowserPluginGuest::RenderViewReady() { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 } | 734 } |
743 | 735 |
744 InitInternal(params, embedder_web_contents); | 736 InitInternal(params, embedder_web_contents); |
745 | 737 |
746 attached_ = true; | 738 attached_ = true; |
747 has_attached_since_surface_set_ = true; | 739 has_attached_since_surface_set_ = true; |
748 SendQueuedMessages(); | 740 SendQueuedMessages(); |
749 | 741 |
750 delegate_->DidAttach(GetGuestProxyRoutingID()); | 742 delegate_->DidAttach(GetGuestProxyRoutingID()); |
751 | 743 |
752 if (!use_site_per_process) { | 744 if (!use_site_per_process) |
753 has_render_view_ = true; | 745 has_render_view_ = true; |
754 | 746 |
755 // Enable input method for guest if it's enabled for the embedder. | |
756 if (static_cast<RenderViewHostImpl*>( | |
757 owner_web_contents_->GetRenderViewHost())->input_method_active()) { | |
758 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( | |
759 GetWebContents()->GetRenderViewHost()); | |
760 guest_rvh->SetInputMethodActive(true); | |
761 } | |
762 } | |
763 | |
764 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); | 747 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); |
765 } | 748 } |
766 | 749 |
767 void BrowserPluginGuest::OnCompositorFrameSwappedACK( | 750 void BrowserPluginGuest::OnCompositorFrameSwappedACK( |
768 int browser_plugin_instance_id, | 751 int browser_plugin_instance_id, |
769 const FrameHostMsg_CompositorFrameSwappedACK_Params& params) { | 752 const FrameHostMsg_CompositorFrameSwappedACK_Params& params) { |
770 RenderWidgetHostImpl::SendSwapCompositorFrameAck(params.producing_route_id, | 753 RenderWidgetHostImpl::SendSwapCompositorFrameAck(params.producing_route_id, |
771 params.output_surface_id, | 754 params.output_surface_id, |
772 params.producing_host_id, | 755 params.producing_host_id, |
773 params.ack); | 756 params.ack); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 988 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
1006 const gfx::Range& range, | 989 const gfx::Range& range, |
1007 const std::vector<gfx::Rect>& character_bounds) { | 990 const std::vector<gfx::Rect>& character_bounds) { |
1008 static_cast<RenderWidgetHostViewBase*>( | 991 static_cast<RenderWidgetHostViewBase*>( |
1009 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 992 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
1010 range, character_bounds); | 993 range, character_bounds); |
1011 } | 994 } |
1012 #endif | 995 #endif |
1013 | 996 |
1014 } // namespace content | 997 } // namespace content |
OLD | NEW |