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

Side by Side Diff: ui/views/controls/button/custom_button.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 2 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 (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 "ui/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 event->type() == ui::ET_GESTURE_END) { 238 event->type() == ui::ET_GESTURE_END) {
239 SetState(STATE_NORMAL); 239 SetState(STATE_NORMAL);
240 } 240 }
241 if (!event->handled()) 241 if (!event->handled())
242 Button::OnGestureEvent(event); 242 Button::OnGestureEvent(event);
243 } 243 }
244 244
245 bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) { 245 bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
246 SetState(STATE_NORMAL); 246 SetState(STATE_NORMAL);
247 // TODO(beng): remove once NotifyClick takes ui::Event. 247 // TODO(beng): remove once NotifyClick takes ui::Event.
248 ui::MouseEvent synthetic_event( 248 ui::MouseEvent synthetic_event(ui::ET_MOUSE_RELEASED, gfx::PointF(),
249 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 249 gfx::PointF(), ui::EventTimeForNow(),
250 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 250 ui::EF_LEFT_MOUSE_BUTTON,
251 ui::EF_LEFT_MOUSE_BUTTON);
251 NotifyClick(synthetic_event); 252 NotifyClick(synthetic_event);
252 return true; 253 return true;
253 } 254 }
254 255
255 void CustomButton::ShowContextMenu(const gfx::Point& p, 256 void CustomButton::ShowContextMenu(const gfx::Point& p,
256 ui::MenuSourceType source_type) { 257 ui::MenuSourceType source_type) {
257 if (!context_menu_controller()) 258 if (!context_menu_controller())
258 return; 259 return;
259 260
260 // We're about to show the context menu. Showing the context menu likely means 261 // We're about to show the context menu. Showing the context menu likely means
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (!details.is_add && state_ != STATE_DISABLED) 341 if (!details.is_add && state_ != STATE_DISABLED)
341 SetState(STATE_NORMAL); 342 SetState(STATE_NORMAL);
342 } 343 }
343 344
344 void CustomButton::OnBlur() { 345 void CustomButton::OnBlur() {
345 if (IsHotTracked()) 346 if (IsHotTracked())
346 SetState(STATE_NORMAL); 347 SetState(STATE_NORMAL);
347 } 348 }
348 349
349 } // namespace views 350 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698