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/renderer/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (focused_plugin_ == instance && render_view_) | 407 if (focused_plugin_ == instance && render_view_) |
408 render_view_->PpapiPluginCaretPositionChanged(); | 408 render_view_->PpapiPluginCaretPositionChanged(); |
409 } | 409 } |
410 | 410 |
411 void PepperPluginDelegateImpl::PluginRequestedCancelComposition( | 411 void PepperPluginDelegateImpl::PluginRequestedCancelComposition( |
412 webkit::ppapi::PluginInstance* instance) { | 412 webkit::ppapi::PluginInstance* instance) { |
413 if (focused_plugin_ == instance && render_view_) | 413 if (focused_plugin_ == instance && render_view_) |
414 render_view_->PpapiPluginCancelComposition(); | 414 render_view_->PpapiPluginCancelComposition(); |
415 } | 415 } |
416 | 416 |
| 417 void PepperPluginDelegateImpl::PluginSelectionChanged( |
| 418 webkit::ppapi::PluginInstance* instance) { |
| 419 if (focused_plugin_ == instance && render_view_) |
| 420 render_view_->PpapiPluginSelectionChanged(); |
| 421 } |
| 422 |
417 void PepperPluginDelegateImpl::OnImeSetComposition( | 423 void PepperPluginDelegateImpl::OnImeSetComposition( |
418 const string16& text, | 424 const string16& text, |
419 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 425 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
420 int selection_start, | 426 int selection_start, |
421 int selection_end) { | 427 int selection_end) { |
422 if (!IsPluginAcceptingCompositionEvents()) { | 428 if (!IsPluginAcceptingCompositionEvents()) { |
423 composition_text_ = text; | 429 composition_text_ = text; |
424 } else { | 430 } else { |
425 // TODO(kinaba) currently all composition events are sent directly to | 431 // TODO(kinaba) currently all composition events are sent directly to |
426 // plugins. Use DOM event mechanism after WebKit is made aware about | 432 // plugins. Use DOM event mechanism after WebKit is made aware about |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return gfx::Rect(0, 0, 0, 0); | 484 return gfx::Rect(0, 0, 0, 0); |
479 return focused_plugin_->GetCaretBounds(); | 485 return focused_plugin_->GetCaretBounds(); |
480 } | 486 } |
481 | 487 |
482 ui::TextInputType PepperPluginDelegateImpl::GetTextInputType() const { | 488 ui::TextInputType PepperPluginDelegateImpl::GetTextInputType() const { |
483 if (!focused_plugin_) | 489 if (!focused_plugin_) |
484 return ui::TEXT_INPUT_TYPE_NONE; | 490 return ui::TEXT_INPUT_TYPE_NONE; |
485 return focused_plugin_->text_input_type(); | 491 return focused_plugin_->text_input_type(); |
486 } | 492 } |
487 | 493 |
| 494 void PepperPluginDelegateImpl::GetSurroundingText(string16* text, |
| 495 ui::Range* range) const { |
| 496 if (!focused_plugin_) |
| 497 return; |
| 498 return focused_plugin_->GetSurroundingText(text, range); |
| 499 } |
| 500 |
488 bool PepperPluginDelegateImpl::IsPluginAcceptingCompositionEvents() const { | 501 bool PepperPluginDelegateImpl::IsPluginAcceptingCompositionEvents() const { |
489 if (!focused_plugin_) | 502 if (!focused_plugin_) |
490 return false; | 503 return false; |
491 return focused_plugin_->IsPluginAcceptingCompositionEvents(); | 504 return focused_plugin_->IsPluginAcceptingCompositionEvents(); |
492 } | 505 } |
493 | 506 |
494 bool PepperPluginDelegateImpl::CanComposeInline() const { | 507 bool PepperPluginDelegateImpl::CanComposeInline() const { |
495 return IsPluginAcceptingCompositionEvents(); | 508 return IsPluginAcceptingCompositionEvents(); |
496 } | 509 } |
497 | 510 |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 1595 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
1583 delete target; | 1596 delete target; |
1584 mouse_lock_instances_.erase(it); | 1597 mouse_lock_instances_.erase(it); |
1585 } | 1598 } |
1586 } | 1599 } |
1587 | 1600 |
1588 webkit_glue::ClipboardClient* | 1601 webkit_glue::ClipboardClient* |
1589 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1602 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1590 return new RendererClipboardClient; | 1603 return new RendererClipboardClient; |
1591 } | 1604 } |
OLD | NEW |