| 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 "content/browser/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } else { | 342 } else { |
| 343 guest_->SendMessageToEmbedder(new BrowserPluginMsg_SetCursor( | 343 guest_->SendMessageToEmbedder(new BrowserPluginMsg_SetCursor( |
| 344 guest_->browser_plugin_instance_id(), cursor)); | 344 guest_->browser_plugin_instance_id(), cursor)); |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { | 348 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { |
| 349 platform_view_->SetIsLoading(is_loading); | 349 platform_view_->SetIsLoading(is_loading); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void RenderWidgetHostViewGuest::TextInputStateChanged( | |
| 353 const ViewHostMsg_TextInputState_Params& params) { | |
| 354 if (!guest_) | |
| 355 return; | |
| 356 | |
| 357 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); | |
| 358 if (!rwhv) | |
| 359 return; | |
| 360 // Forward the information to embedding RWHV. | |
| 361 rwhv->TextInputStateChanged(params); | |
| 362 } | |
| 363 | |
| 364 void RenderWidgetHostViewGuest::ImeCancelComposition() { | 352 void RenderWidgetHostViewGuest::ImeCancelComposition() { |
| 365 if (!guest_) | 353 if (!guest_) |
| 366 return; | 354 return; |
| 367 | 355 |
| 368 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); | 356 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); |
| 369 if (!rwhv) | 357 if (!rwhv) |
| 370 return; | 358 return; |
| 371 // Forward the information to embedding RWHV. | 359 // Forward the information to embedding RWHV. |
| 372 rwhv->ImeCancelComposition(); | 360 rwhv->ImeCancelComposition(); |
| 373 } | 361 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 502 |
| 515 void RenderWidgetHostViewGuest::UnlockCompositingSurface() { | 503 void RenderWidgetHostViewGuest::UnlockCompositingSurface() { |
| 516 NOTIMPLEMENTED(); | 504 NOTIMPLEMENTED(); |
| 517 } | 505 } |
| 518 | 506 |
| 519 void RenderWidgetHostViewGuest::DestroyGuestView() { | 507 void RenderWidgetHostViewGuest::DestroyGuestView() { |
| 520 // Let our observers know we're going away, since we don't want any event | 508 // Let our observers know we're going away, since we don't want any event |
| 521 // processing calls coming in after we release host_. | 509 // processing calls coming in after we release host_. |
| 522 NotifyObserversAboutShutdown(); | 510 NotifyObserversAboutShutdown(); |
| 523 | 511 |
| 512 // The WebContentsImpl should be notified about us so that it will not hold |
| 513 // an invalid text input state which was due to active text on this view. |
| 514 NotifyHostDelegateAboutShutdown(); |
| 515 |
| 524 host_->SetView(NULL); | 516 host_->SetView(NULL); |
| 525 host_ = NULL; | 517 host_ = NULL; |
| 526 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 518 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 527 } | 519 } |
| 528 | 520 |
| 529 RenderWidgetHostViewBase* | 521 RenderWidgetHostViewBase* |
| 530 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { | 522 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { |
| 531 return static_cast<RenderWidgetHostViewBase*>( | 523 return static_cast<RenderWidgetHostViewBase*>( |
| 532 guest_->GetOwnerRenderWidgetHostView()); | 524 guest_->GetOwnerRenderWidgetHostView()); |
| 533 } | 525 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && | 611 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && |
| 620 gesture_event.data.scrollUpdate.inertial) { | 612 gesture_event.data.scrollUpdate.inertial) { |
| 621 return; | 613 return; |
| 622 } | 614 } |
| 623 host_->ForwardGestureEvent(gesture_event); | 615 host_->ForwardGestureEvent(gesture_event); |
| 624 return; | 616 return; |
| 625 } | 617 } |
| 626 } | 618 } |
| 627 | 619 |
| 628 } // namespace content | 620 } // namespace content |
| OLD | NEW |