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

Side by Side Diff: ash/ime/candidate_view.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/ime/candidate_view.h" 5 #include "ash/ime/candidate_view.h"
6 6
7 #include "ash/ime/candidate_window_constants.h" 7 #include "ash/ime/candidate_window_constants.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "ui/base/ime/candidate_window.h" 9 #include "ui/base/ime/candidate_window.h"
10 #include "ui/gfx/color_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 SchedulePaint(); 219 SchedulePaint();
220 } 220 }
221 221
222 void CandidateView::StateChanged() { 222 void CandidateView::StateChanged() {
223 shortcut_label_->SetEnabled(state() != STATE_DISABLED); 223 shortcut_label_->SetEnabled(state() != STATE_DISABLED);
224 if (state() == STATE_PRESSED) 224 if (state() == STATE_PRESSED)
225 SetHighlighted(true); 225 SetHighlighted(true);
226 } 226 }
227 227
228 bool CandidateView::OnMouseDragged(const ui::MouseEvent& event) { 228 bool CandidateView::OnMouseDragged(const ui::MouseEvent& event) {
229 if (!HitTestPoint(event.location())) { 229 if (!HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
230 // Moves the drag target to the sibling view. 230 // Moves the drag target to the sibling view.
231 gfx::Point location_in_widget(event.location()); 231 gfx::Point location_in_widget(gfx::ToFlooredPoint(event.location()));
232 ConvertPointToWidget(this, &location_in_widget); 232 ConvertPointToWidget(this, &location_in_widget);
233 for (int i = 0; i < parent()->child_count(); ++i) { 233 for (int i = 0; i < parent()->child_count(); ++i) {
234 CandidateView* sibling = 234 CandidateView* sibling =
235 static_cast<CandidateView*>(parent()->child_at(i)); 235 static_cast<CandidateView*>(parent()->child_at(i));
236 if (sibling == this) 236 if (sibling == this)
237 continue; 237 continue;
238 gfx::Point location_in_sibling(location_in_widget); 238 gfx::Point location_in_sibling(location_in_widget);
239 ConvertPointFromWidget(sibling, &location_in_sibling); 239 ConvertPointFromWidget(sibling, &location_in_sibling);
240 if (sibling->HitTestPoint(location_in_sibling)) { 240 if (sibling->HitTestPoint(location_in_sibling)) {
241 GetWidget()->GetRootView()->SetMouseHandler(sibling); 241 GetWidget()->GetRootView()->SetMouseHandler(sibling);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 // Reserves the margin for infolist_icon even if it's not visible. 294 // Reserves the margin for infolist_icon even if it's not visible.
295 size.Enlarge( 295 size.Enlarge(
296 kInfolistIndicatorIconWidth + kInfolistIndicatorIconPadding * 2, 0); 296 kInfolistIndicatorIconWidth + kInfolistIndicatorIconPadding * 2, 0);
297 return size; 297 return size;
298 } 298 }
299 299
300 } // namespace ime 300 } // namespace ime
301 } // namespace ash 301 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698