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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 // embedder shutdown or when the embedder navigates to a different page. | 643 // embedder shutdown or when the embedder navigates to a different page. |
644 // The call stack is roughly: | 644 // The call stack is roughly: |
645 // BrowserPluginGuest::SetFocus() | 645 // BrowserPluginGuest::SetFocus() |
646 // content::InterstitialPageImpl::Hide() | 646 // content::InterstitialPageImpl::Hide() |
647 // content::InterstitialPageImpl::DontProceed(). | 647 // content::InterstitialPageImpl::DontProceed(). |
648 // | 648 // |
649 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. | 649 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. |
650 return; | 650 return; |
651 } | 651 } |
652 | 652 |
653 if (last_text_input_state_.get()) | 653 if (last_text_input_state_.get()) { |
654 guest_rwhv->TextInputStateChanged(*last_text_input_state_); | 654 guest_rwhv->TextInputStateChanged(*last_text_input_state_); |
| 655 if (auto* rwh = |
| 656 RenderWidgetHostImpl::From(guest_rwhv->GetRenderWidgetHost())) { |
| 657 // We need composition range information for some IMEs. To get the |
| 658 // updates, we need to explicitly ask the renderer to monitor and send the |
| 659 // composition information changes. RenderWidgetHostView of the page will |
| 660 // send the request to its process but the machinery for forwarding it to |
| 661 // BrowserPlugin is not there. Therefore, we send a direct request to the |
| 662 // guest process to start monitoring the state (see |
| 663 // https://crbug.com/714771). |
| 664 rwh->RequestCompositionUpdates( |
| 665 false, last_text_input_state_->type != ui::TEXT_INPUT_TYPE_NONE); |
| 666 } |
| 667 } |
655 } | 668 } |
656 | 669 |
657 void BrowserPluginGuest::DidFinishNavigation( | 670 void BrowserPluginGuest::DidFinishNavigation( |
658 NavigationHandle* navigation_handle) { | 671 NavigationHandle* navigation_handle) { |
659 if (navigation_handle->HasCommitted()) | 672 if (navigation_handle->HasCommitted()) |
660 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 673 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
661 } | 674 } |
662 | 675 |
663 void BrowserPluginGuest::RenderViewReady() { | 676 void BrowserPluginGuest::RenderViewReady() { |
664 if (GuestMode::IsCrossProcessFrameGuest(GetWebContents())) | 677 if (GuestMode::IsCrossProcessFrameGuest(GetWebContents())) |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 range, character_bounds); | 1085 range, character_bounds); |
1073 } | 1086 } |
1074 #endif | 1087 #endif |
1075 | 1088 |
1076 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1089 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1077 if (delegate_) | 1090 if (delegate_) |
1078 delegate_->SetContextMenuPosition(position); | 1091 delegate_->SetContextMenuPosition(position); |
1079 } | 1092 } |
1080 | 1093 |
1081 } // namespace content | 1094 } // namespace content |
OLD | NEW |