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

Unified Diff: ash/launcher/launcher_button.cc

Issue 10702102: Added hover feedback on touch to launcher buttons. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed stale include. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« ash/launcher/launcher_button.h ('K') | « ash/launcher/launcher_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_button.cc
diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc
index 4f482188ac37b13b2d0e6ae2ceec038e387df4bb..7318bc7195951ca8fb2bc59d02b20d389736d88a 100644
--- a/ash/launcher/launcher_button.cc
+++ b/ash/launcher/launcher_button.cc
@@ -10,10 +10,12 @@
#include "ash/launcher/launcher_button_host.h"
#include "grit/ui_resources.h"
#include "skia/ext/image_operations.h"
+#include "ui/aura/event.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/events.h"
flackr 2012/07/05 14:11:12 Sort
Kevin Greer 2012/07/05 18:35:04 Done.
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_element.h"
#include "ui/compositor/layer_animation_observer.h"
@@ -325,6 +327,18 @@ gfx::Rect LauncherButton::GetIconBounds() const {
return icon_view_->bounds();
}
+ui::GestureStatus LauncherButton::OnGestureEvent(
+ const views::GestureEvent& event) {
+ ui::GestureStatus status = CustomButton::OnGestureEvent(event);
+
+ if (event.type() == ui::ET_GESTURE_TAP_DOWN)
+ AddState(STATE_HOVERED);
flackr 2012/07/05 14:11:12 Since this class derives from CustomButton, I thin
Kevin Greer 2012/07/05 21:06:05 LauncherButton creates its own new set of states t
flackr 2012/07/06 03:12:59 What I have in mind is to use CustomButton's track
+ else if (event.type() == ui::ET_GESTURE_END)
+ ClearState(STATE_HOVERED);
+
+ return status;
+}
+
bool LauncherButton::OnMousePressed(const views::MouseEvent& event) {
CustomButton::OnMousePressed(event);
host_->MousePressedOnButton(this, event);
« ash/launcher/launcher_button.h ('K') | « ash/launcher/launcher_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698