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

Side by Side Diff: ash/launcher/launcher_button.cc

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_button.h ('k') | ash/launcher/launcher_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/launcher/launcher_button.h" 5 #include "ash/launcher/launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/launcher/launcher_button_host.h" 10 #include "ash/launcher/launcher_button_host.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 bar_->ShowAttention(false); 318 bar_->ShowAttention(false);
319 if (state & STATE_PENDING) 319 if (state & STATE_PENDING)
320 icon_pulse_animation_.reset(); 320 icon_pulse_animation_.reset();
321 } 321 }
322 } 322 }
323 323
324 gfx::Rect LauncherButton::GetIconBounds() const { 324 gfx::Rect LauncherButton::GetIconBounds() const {
325 return icon_view_->bounds(); 325 return icon_view_->bounds();
326 } 326 }
327 327
328 bool LauncherButton::OnMousePressed(const views::MouseEvent& event) { 328 bool LauncherButton::OnMousePressed(const ui::MouseEvent& event) {
329 CustomButton::OnMousePressed(event); 329 CustomButton::OnMousePressed(event);
330 host_->PointerPressedOnButton(this, LauncherButtonHost::MOUSE, event); 330 host_->PointerPressedOnButton(this, LauncherButtonHost::MOUSE, event);
331 return true; 331 return true;
332 } 332 }
333 333
334 void LauncherButton::OnMouseReleased(const views::MouseEvent& event) { 334 void LauncherButton::OnMouseReleased(const ui::MouseEvent& event) {
335 CustomButton::OnMouseReleased(event); 335 CustomButton::OnMouseReleased(event);
336 host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, false); 336 host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, false);
337 } 337 }
338 338
339 void LauncherButton::OnMouseCaptureLost() { 339 void LauncherButton::OnMouseCaptureLost() {
340 ClearState(STATE_HOVERED); 340 ClearState(STATE_HOVERED);
341 host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, true); 341 host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, true);
342 CustomButton::OnMouseCaptureLost(); 342 CustomButton::OnMouseCaptureLost();
343 } 343 }
344 344
345 bool LauncherButton::OnMouseDragged(const views::MouseEvent& event) { 345 bool LauncherButton::OnMouseDragged(const ui::MouseEvent& event) {
346 CustomButton::OnMouseDragged(event); 346 CustomButton::OnMouseDragged(event);
347 host_->PointerDraggedOnButton(this, LauncherButtonHost::MOUSE, event); 347 host_->PointerDraggedOnButton(this, LauncherButtonHost::MOUSE, event);
348 return true; 348 return true;
349 } 349 }
350 350
351 void LauncherButton::OnMouseMoved(const views::MouseEvent& event) { 351 void LauncherButton::OnMouseMoved(const ui::MouseEvent& event) {
352 CustomButton::OnMouseMoved(event); 352 CustomButton::OnMouseMoved(event);
353 host_->MouseMovedOverButton(this); 353 host_->MouseMovedOverButton(this);
354 } 354 }
355 355
356 void LauncherButton::OnMouseEntered(const views::MouseEvent& event) { 356 void LauncherButton::OnMouseEntered(const ui::MouseEvent& event) {
357 AddState(STATE_HOVERED); 357 AddState(STATE_HOVERED);
358 CustomButton::OnMouseEntered(event); 358 CustomButton::OnMouseEntered(event);
359 host_->MouseEnteredButton(this); 359 host_->MouseEnteredButton(this);
360 } 360 }
361 361
362 void LauncherButton::OnMouseExited(const views::MouseEvent& event) { 362 void LauncherButton::OnMouseExited(const ui::MouseEvent& event) {
363 ClearState(STATE_HOVERED); 363 ClearState(STATE_HOVERED);
364 CustomButton::OnMouseExited(event); 364 CustomButton::OnMouseExited(event);
365 host_->MouseExitedButton(this); 365 host_->MouseExitedButton(this);
366 } 366 }
367 367
368 ui::GestureStatus LauncherButton::OnGestureEvent( 368 ui::GestureStatus LauncherButton::OnGestureEvent(
369 const views::GestureEvent& event) { 369 const views::GestureEvent& event) {
370 switch (event.type()) { 370 switch (event.type()) {
371 case ui::ET_GESTURE_TAP_DOWN: 371 case ui::ET_GESTURE_TAP_DOWN:
372 AddState(STATE_HOVERED); 372 AddState(STATE_HOVERED);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 bar_->SetVerticalAlignment(views::ImageView::CENTER); 502 bar_->SetVerticalAlignment(views::ImageView::CENTER);
503 break; 503 break;
504 } 504 }
505 505
506 Layout(); 506 Layout();
507 SchedulePaint(); 507 SchedulePaint();
508 } 508 }
509 509
510 } // namespace internal 510 } // namespace internal
511 } // namespace ash 511 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_button.h ('k') | ash/launcher/launcher_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698