| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } else { | 341 } else { |
| 342 guest_->SendMessageToEmbedder(new BrowserPluginMsg_SetCursor( | 342 guest_->SendMessageToEmbedder(new BrowserPluginMsg_SetCursor( |
| 343 guest_->browser_plugin_instance_id(), cursor)); | 343 guest_->browser_plugin_instance_id(), cursor)); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | 346 |
| 347 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { | 347 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { |
| 348 platform_view_->SetIsLoading(is_loading); | 348 platform_view_->SetIsLoading(is_loading); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void RenderWidgetHostViewGuest::TextInputStateChanged( |
| 352 const ViewHostMsg_TextInputState_Params& params) { |
| 353 if (!guest_) |
| 354 return; |
| 355 |
| 356 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); |
| 357 if (!rwhv) |
| 358 return; |
| 359 // Forward the information to embedding RWHV. |
| 360 rwhv->TextInputStateChanged(params); |
| 361 } |
| 362 |
| 351 void RenderWidgetHostViewGuest::ImeCancelComposition() { | 363 void RenderWidgetHostViewGuest::ImeCancelComposition() { |
| 352 if (!guest_) | 364 if (!guest_) |
| 353 return; | 365 return; |
| 354 | 366 |
| 355 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); | 367 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); |
| 356 if (!rwhv) | 368 if (!rwhv) |
| 357 return; | 369 return; |
| 358 // Forward the information to embedding RWHV. | 370 // Forward the information to embedding RWHV. |
| 359 rwhv->ImeCancelComposition(); | 371 rwhv->ImeCancelComposition(); |
| 360 } | 372 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 499 |
| 488 void RenderWidgetHostViewGuest::UnlockCompositingSurface() { | 500 void RenderWidgetHostViewGuest::UnlockCompositingSurface() { |
| 489 NOTIMPLEMENTED(); | 501 NOTIMPLEMENTED(); |
| 490 } | 502 } |
| 491 | 503 |
| 492 void RenderWidgetHostViewGuest::DestroyGuestView() { | 504 void RenderWidgetHostViewGuest::DestroyGuestView() { |
| 493 // Let our observers know we're going away, since we don't want any event | 505 // Let our observers know we're going away, since we don't want any event |
| 494 // processing calls coming in after we release host_. | 506 // processing calls coming in after we release host_. |
| 495 NotifyObserversAboutShutdown(); | 507 NotifyObserversAboutShutdown(); |
| 496 | 508 |
| 497 // The WebContentsImpl should be notified about us so that it will not hold | |
| 498 // an invalid text input state which was due to active text on this view. | |
| 499 NotifyHostDelegateAboutShutdown(); | |
| 500 | |
| 501 host_->SetView(NULL); | 509 host_->SetView(NULL); |
| 502 host_ = NULL; | 510 host_ = NULL; |
| 503 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 511 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 504 } | 512 } |
| 505 | 513 |
| 506 RenderWidgetHostViewBase* | 514 RenderWidgetHostViewBase* |
| 507 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { | 515 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { |
| 508 return static_cast<RenderWidgetHostViewBase*>( | 516 return static_cast<RenderWidgetHostViewBase*>( |
| 509 guest_->GetOwnerRenderWidgetHostView()); | 517 guest_->GetOwnerRenderWidgetHostView()); |
| 510 } | 518 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && | 604 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && |
| 597 gesture_event.data.scrollUpdate.inertial) { | 605 gesture_event.data.scrollUpdate.inertial) { |
| 598 return; | 606 return; |
| 599 } | 607 } |
| 600 host_->ForwardGestureEvent(gesture_event); | 608 host_->ForwardGestureEvent(gesture_event); |
| 601 return; | 609 return; |
| 602 } | 610 } |
| 603 } | 611 } |
| 604 | 612 |
| 605 } // namespace content | 613 } // namespace content |
| OLD | NEW |