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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 1282823002: Add text offset to OnSurroundingTextChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/input_method/input_method_engine.h" 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
6 6
7 #undef FocusIn 7 #undef FocusIn
8 #undef FocusOut 8 #undef FocusOut
9 #undef RootWindow 9 #undef RootWindow
10 #include <map> 10 #include <map>
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 return; 651 return;
652 } 652 }
653 653
654 // Only left button click is supported at this moment. 654 // Only left button click is supported at this moment.
655 observer_->OnCandidateClicked( 655 observer_->OnCandidateClicked(
656 active_component_id_, candidate_ids_.at(index), MOUSE_BUTTON_LEFT); 656 active_component_id_, candidate_ids_.at(index), MOUSE_BUTTON_LEFT);
657 } 657 }
658 658
659 void InputMethodEngine::SetSurroundingText(const std::string& text, 659 void InputMethodEngine::SetSurroundingText(const std::string& text,
660 uint32 cursor_pos, 660 uint32 cursor_pos,
661 uint32 anchor_pos) { 661 uint32 anchor_pos,
662 uint32 offset_pos) {
662 if (!CheckProfile()) 663 if (!CheckProfile())
663 return; 664 return;
664 observer_->OnSurroundingTextChanged(active_component_id_, 665 observer_->OnSurroundingTextChanged(
665 text, 666 active_component_id_, text, static_cast<int>(cursor_pos),
666 static_cast<int>(cursor_pos), 667 static_cast<int>(anchor_pos), static_cast<int>(offset_pos));
667 static_cast<int>(anchor_pos));
668 } 668 }
669 669
670 bool InputMethodEngine::CheckProfile() const { 670 bool InputMethodEngine::CheckProfile() const {
671 Profile* active_profile = ProfileManager::GetActiveUserProfile(); 671 Profile* active_profile = ProfileManager::GetActiveUserProfile();
672 return active_profile == profile_ || profile_->IsSameProfile(active_profile); 672 return active_profile == profile_ || profile_->IsSameProfile(active_profile);
673 } 673 }
674 674
675 // TODO(uekawa): rename this method to a more reasonable name. 675 // TODO(uekawa): rename this method to a more reasonable name.
676 void InputMethodEngine::MenuItemToProperty( 676 void InputMethodEngine::MenuItemToProperty(
677 const MenuItem& item, 677 const MenuItem& item,
(...skipping 30 matching lines...) Expand all
708 // TODO(nona): Implement it. 708 // TODO(nona): Implement it.
709 break; 709 break;
710 } 710 }
711 } 711 }
712 } 712 }
713 713
714 // TODO(nona): Support item.children. 714 // TODO(nona): Support item.children.
715 } 715 }
716 716
717 } // namespace chromeos 717 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698