Index: chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc |
diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc |
index 2f917020be001a74e73606533960a0dd9a81b789..fb60bc8b1f482bc10980d1b63a61f4f2b1b54fff 100644 |
--- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc |
+++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc |
@@ -124,23 +124,31 @@ void CandidateWindowControllerImpl::OnHidePreeditText() { |
} |
void CandidateWindowControllerImpl::OnSetCursorLocation( |
- const gfx::Rect& cursor_location, |
- const gfx::Rect& composition_head) { |
+ const ibus::Rect& cursor_location, |
+ const ibus::Rect& composition_head) { |
// A workaround for http://crosbug.com/6460. We should ignore very short Y |
// move to prevent the window from shaking up and down. |
const int kKeepPositionThreshold = 2; // px |
const gfx::Rect& last_location = |
candidate_window_->cursor_location(); |
- const int delta_y = abs(last_location.y() - cursor_location.y()); |
- if ((last_location.x() == cursor_location.x()) && |
+ const int delta_y = abs(last_location.y() - cursor_location.y); |
+ if ((last_location.x() == cursor_location.x) && |
(delta_y <= kKeepPositionThreshold)) { |
DVLOG(1) << "Ignored set_cursor_location signal to prevent window shake"; |
return; |
} |
// Remember the cursor location. |
- candidate_window_->set_cursor_location(cursor_location); |
- candidate_window_->set_composition_head_location(composition_head); |
+ candidate_window_->set_cursor_location( |
+ gfx::Rect(cursor_location.x, |
+ cursor_location.y, |
+ cursor_location.width, |
+ cursor_location.height)); |
satorux1
2013/01/29 05:16:08
Cannot we do something like:
candidate_window_->s
Seigo Nonaka
2013/01/30 06:00:07
We can't add member function into ibus::Rect struc
|
+ candidate_window_->set_composition_head_location( |
+ gfx::Rect(composition_head.x, |
+ composition_head.y, |
+ composition_head.width, |
+ composition_head.height)); |
// Move the window per the cursor location. |
candidate_window_->ResizeAndMoveParentFrame(); |
UpdateInfolistBounds(); |