Chromium Code Reviews| 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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 } | 294 } |
| 295 | 295 |
| 296 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { | 296 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { |
| 297 platform_view_->SetIsLoading(is_loading); | 297 platform_view_->SetIsLoading(is_loading); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void RenderWidgetHostViewGuest::TextInputTypeChanged( | 300 void RenderWidgetHostViewGuest::TextInputTypeChanged( |
| 301 ui::TextInputType type, | 301 ui::TextInputType type, |
| 302 ui::TextInputMode input_mode, | 302 ui::TextInputMode input_mode, |
| 303 bool can_compose_inline) { | 303 bool can_compose_inline) { |
| 304 RenderWidgetHostViewPort::FromRWHV( | 304 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( |
| 305 guest_->GetEmbedderRenderWidgetHostView())-> | 305 guest_->GetEmbedderRenderWidgetHostView()); |
| 306 TextInputTypeChanged(type, input_mode, can_compose_inline); | 306 if (!rwhv) |
| 307 return; | |
| 308 // Forward the information to embedding RWHV. | |
| 309 rwhv->TextInputTypeChanged(type, input_mode, can_compose_inline); | |
| 307 } | 310 } |
| 308 | 311 |
| 309 void RenderWidgetHostViewGuest::ImeCancelComposition() { | 312 void RenderWidgetHostViewGuest::ImeCancelComposition() { |
| 310 platform_view_->ImeCancelComposition(); | 313 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( |
| 314 guest_->GetEmbedderRenderWidgetHostView()); | |
| 315 if (!rwhv) | |
| 316 return; | |
| 317 // Forward the information to embedding RWHV. | |
| 318 rwhv->ImeCancelComposition(); | |
| 311 } | 319 } |
| 312 | 320 |
| 313 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) | 321 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) |
| 314 void RenderWidgetHostViewGuest::ImeCompositionRangeChanged( | 322 void RenderWidgetHostViewGuest::ImeCompositionRangeChanged( |
| 315 const gfx::Range& range, | 323 const gfx::Range& range, |
| 316 const std::vector<gfx::Rect>& character_bounds) { | 324 const std::vector<gfx::Rect>& character_bounds) { |
| 325 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( | |
| 326 guest_->GetEmbedderRenderWidgetHostView()); | |
| 327 if (!rwhv) | |
| 328 return; | |
| 329 std::vector<gfx::Rect> guest_character_bounds; | |
| 330 for (size_t i = 0; i < character_bounds.size(); ++i) { | |
| 331 gfx::Rect guest_rect = guest_->ToGuestRect(character_bounds[i]); | |
| 332 guest_character_bounds.push_back(guest_rect); | |
| 333 } | |
|
kochi
2013/12/13 06:41:24
Self-review: This part was missing.
As in Selecti
| |
| 334 // Forward the information to embedding RWHV. | |
| 335 rwhv->ImeCompositionRangeChanged(range, guest_character_bounds); | |
| 317 } | 336 } |
| 318 #endif | 337 #endif |
| 319 | 338 |
| 320 void RenderWidgetHostViewGuest::DidUpdateBackingStore( | 339 void RenderWidgetHostViewGuest::DidUpdateBackingStore( |
| 321 const gfx::Rect& scroll_rect, | 340 const gfx::Rect& scroll_rect, |
| 322 const gfx::Vector2d& scroll_delta, | 341 const gfx::Vector2d& scroll_delta, |
| 323 const std::vector<gfx::Rect>& copy_rects, | 342 const std::vector<gfx::Rect>& copy_rects, |
| 324 const ui::LatencyInfo& latency_info) { | 343 const ui::LatencyInfo& latency_info) { |
| 325 NOTREACHED(); | 344 NOTREACHED(); |
| 326 } | 345 } |
| 327 | 346 |
| 328 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, | 347 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, |
| 329 size_t offset, | 348 size_t offset, |
| 330 const gfx::Range& range) { | 349 const gfx::Range& range) { |
| 331 platform_view_->SelectionChanged(text, offset, range); | 350 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( |
| 351 guest_->GetEmbedderRenderWidgetHostView()); | |
| 352 if (!rwhv) | |
| 353 return; | |
| 354 // Forward the information to embedding RWHV. | |
| 355 rwhv->SelectionChanged(text, offset, range); | |
| 332 } | 356 } |
| 333 | 357 |
| 334 void RenderWidgetHostViewGuest::SelectionBoundsChanged( | 358 void RenderWidgetHostViewGuest::SelectionBoundsChanged( |
| 335 const ViewHostMsg_SelectionBounds_Params& params) { | 359 const ViewHostMsg_SelectionBounds_Params& params) { |
| 336 platform_view_->SelectionBoundsChanged(params); | 360 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( |
| 361 guest_->GetEmbedderRenderWidgetHostView()); | |
| 362 if (!rwhv) | |
| 363 return; | |
| 364 ViewHostMsg_SelectionBounds_Params guest_params(params); | |
| 365 guest_params.anchor_rect = guest_->ToGuestRect(params.anchor_rect); | |
| 366 guest_params.focus_rect = guest_->ToGuestRect(params.focus_rect); | |
| 367 rwhv->SelectionBoundsChanged(guest_params); | |
| 337 } | 368 } |
| 338 | 369 |
| 339 void RenderWidgetHostViewGuest::ScrollOffsetChanged() { | 370 void RenderWidgetHostViewGuest::ScrollOffsetChanged() { |
| 340 } | 371 } |
| 341 | 372 |
| 342 BackingStore* RenderWidgetHostViewGuest::AllocBackingStore( | 373 BackingStore* RenderWidgetHostViewGuest::AllocBackingStore( |
| 343 const gfx::Size& size) { | 374 const gfx::Size& size) { |
| 344 NOTREACHED(); | 375 NOTREACHED(); |
| 345 return NULL; | 376 return NULL; |
| 346 } | 377 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 590 return; | 621 return; |
| 591 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); | 622 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); |
| 592 g_it != gestures->end(); | 623 g_it != gestures->end(); |
| 593 ++g_it) { | 624 ++g_it) { |
| 594 ForwardGestureEventToRenderer(*g_it); | 625 ForwardGestureEventToRenderer(*g_it); |
| 595 } | 626 } |
| 596 } | 627 } |
| 597 | 628 |
| 598 | 629 |
| 599 } // namespace content | 630 } // namespace content |
| OLD | NEW |