| 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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 pending_messages_.pop_front(); | 489 pending_messages_.pop_front(); |
| 490 SendMessageToEmbedder(message_ptr.release()); | 490 SendMessageToEmbedder(message_ptr.release()); |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 | 493 |
| 494 void BrowserPluginGuest::SendTextInputTypeChangedToView( | 494 void BrowserPluginGuest::SendTextInputTypeChangedToView( |
| 495 RenderWidgetHostViewBase* guest_rwhv) { | 495 RenderWidgetHostViewBase* guest_rwhv) { |
| 496 if (!guest_rwhv) | 496 if (!guest_rwhv) |
| 497 return; | 497 return; |
| 498 | 498 |
| 499 if (!owner_web_contents_) { |
| 500 // If we were showing an interstitial, then we can end up here during |
| 501 // embedder shutdown or when the embedder navigates to a different page. |
| 502 // The call stack is roughly: |
| 503 // BrowserPluginGuest::SetFocus() |
| 504 // content::InterstitialPageImpl::Hide() |
| 505 // content::InterstitialPageImpl::DontProceed(). |
| 506 // |
| 507 // TODO(lazyboy): Write a WebUI test once http://crbug.com/463674 is fixed. |
| 508 return; |
| 509 } |
| 510 |
| 499 guest_rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, | 511 guest_rwhv->TextInputTypeChanged(last_text_input_type_, last_input_mode_, |
| 500 last_can_compose_inline_, last_input_flags_); | 512 last_can_compose_inline_, last_input_flags_); |
| 501 // Enable input method for guest if it's enabled for the embedder. | 513 // Enable input method for guest if it's enabled for the embedder. |
| 502 if (!static_cast<RenderViewHostImpl*>( | 514 if (!static_cast<RenderViewHostImpl*>( |
| 503 owner_web_contents_->GetRenderViewHost())->input_method_active()) { | 515 owner_web_contents_->GetRenderViewHost())->input_method_active()) { |
| 504 return; | 516 return; |
| 505 } | 517 } |
| 506 RenderViewHostImpl* guest_rvh = | 518 RenderViewHostImpl* guest_rvh = |
| 507 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()); | 519 static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()); |
| 508 guest_rvh->SetInputMethodActive(true); | 520 guest_rvh->SetInputMethodActive(true); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 928 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
| 917 const gfx::Range& range, | 929 const gfx::Range& range, |
| 918 const std::vector<gfx::Rect>& character_bounds) { | 930 const std::vector<gfx::Rect>& character_bounds) { |
| 919 static_cast<RenderWidgetHostViewBase*>( | 931 static_cast<RenderWidgetHostViewBase*>( |
| 920 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 932 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
| 921 range, character_bounds); | 933 range, character_bounds); |
| 922 } | 934 } |
| 923 #endif | 935 #endif |
| 924 | 936 |
| 925 } // namespace content | 937 } // namespace content |
| OLD | NEW |