Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 8769003: Pepper IME API for surrounding text retrieval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sort. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 if (focused_plugin_ == instance && render_view_) 607 if (focused_plugin_ == instance && render_view_)
608 render_view_->PpapiPluginCaretPositionChanged(); 608 render_view_->PpapiPluginCaretPositionChanged();
609 } 609 }
610 610
611 void PepperPluginDelegateImpl::PluginRequestedCancelComposition( 611 void PepperPluginDelegateImpl::PluginRequestedCancelComposition(
612 webkit::ppapi::PluginInstance* instance) { 612 webkit::ppapi::PluginInstance* instance) {
613 if (focused_plugin_ == instance && render_view_) 613 if (focused_plugin_ == instance && render_view_)
614 render_view_->PpapiPluginCancelComposition(); 614 render_view_->PpapiPluginCancelComposition();
615 } 615 }
616 616
617 void PepperPluginDelegateImpl::PluginSelectionChanged(
618 webkit::ppapi::PluginInstance* instance) {
619 if (focused_plugin_ == instance && render_view_)
620 render_view_->PpapiPluginSelectionChanged();
621 }
622
617 void PepperPluginDelegateImpl::OnImeSetComposition( 623 void PepperPluginDelegateImpl::OnImeSetComposition(
618 const string16& text, 624 const string16& text,
619 const std::vector<WebKit::WebCompositionUnderline>& underlines, 625 const std::vector<WebKit::WebCompositionUnderline>& underlines,
620 int selection_start, 626 int selection_start,
621 int selection_end) { 627 int selection_end) {
622 if (!IsPluginAcceptingCompositionEvents()) { 628 if (!IsPluginAcceptingCompositionEvents()) {
623 composition_text_ = text; 629 composition_text_ = text;
624 } else { 630 } else {
625 // TODO(kinaba) currently all composition events are sent directly to 631 // TODO(kinaba) currently all composition events are sent directly to
626 // plugins. Use DOM event mechanism after WebKit is made aware about 632 // plugins. Use DOM event mechanism after WebKit is made aware about
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 return gfx::Rect(0, 0, 0, 0); 684 return gfx::Rect(0, 0, 0, 0);
679 return focused_plugin_->GetCaretBounds(); 685 return focused_plugin_->GetCaretBounds();
680 } 686 }
681 687
682 ui::TextInputType PepperPluginDelegateImpl::GetTextInputType() const { 688 ui::TextInputType PepperPluginDelegateImpl::GetTextInputType() const {
683 if (!focused_plugin_) 689 if (!focused_plugin_)
684 return ui::TEXT_INPUT_TYPE_NONE; 690 return ui::TEXT_INPUT_TYPE_NONE;
685 return focused_plugin_->text_input_type(); 691 return focused_plugin_->text_input_type();
686 } 692 }
687 693
694 void PepperPluginDelegateImpl::GetSurroundingText(string16* text,
695 ui::Range* range) const {
696 if (!focused_plugin_)
697 return;
698 return focused_plugin_->GetSurroundingText(text, range);
699 }
700
688 bool PepperPluginDelegateImpl::IsPluginAcceptingCompositionEvents() const { 701 bool PepperPluginDelegateImpl::IsPluginAcceptingCompositionEvents() const {
689 if (!focused_plugin_) 702 if (!focused_plugin_)
690 return false; 703 return false;
691 return focused_plugin_->IsPluginAcceptingCompositionEvents(); 704 return focused_plugin_->IsPluginAcceptingCompositionEvents();
692 } 705 }
693 706
694 bool PepperPluginDelegateImpl::CanComposeInline() const { 707 bool PepperPluginDelegateImpl::CanComposeInline() const {
695 return IsPluginAcceptingCompositionEvents(); 708 return IsPluginAcceptingCompositionEvents();
696 } 709 }
697 710
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); 1809 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target);
1797 delete target; 1810 delete target;
1798 mouse_lock_instances_.erase(it); 1811 mouse_lock_instances_.erase(it);
1799 } 1812 }
1800 } 1813 }
1801 1814
1802 webkit_glue::ClipboardClient* 1815 webkit_glue::ClipboardClient*
1803 PepperPluginDelegateImpl::CreateClipboardClient() const { 1816 PepperPluginDelegateImpl::CreateClipboardClient() const {
1804 return new RendererClipboardClient; 1817 return new RendererClipboardClient;
1805 } 1818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698