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

Unified Diff: ui/views/view.cc

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to refactor ink drop animations (moving more stuff into InkDropDelegate) Created 5 years, 1 month 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
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 0fc755972d6d57de055a7ea9d31fa11733eaf13b..2b7a2a40f6e4b9f23668626f09a887c1d2718394 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -39,6 +39,7 @@
#include "ui/gfx/transform.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/native_view_accessibility.h"
+#include "ui/views/animation/ink_drop_delegate.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/context_menu_controller.h"
@@ -518,6 +519,10 @@ void View::Layout() {
child->Layout();
}
}
+
+ InkDropDelegate* ink_drop_delegate = GetInkDropDelegate();
+ if (ink_drop_delegate)
+ ink_drop_delegate->Layout();
}
void View::InvalidateLayout() {
@@ -1015,6 +1020,9 @@ void View::OnTouchEvent(ui::TouchEvent* event) {
}
void View::OnGestureEvent(ui::GestureEvent* event) {
+ InkDropDelegate* ink_drop_delegate = GetInkDropDelegate();
+ if (ink_drop_delegate)
+ ink_drop_delegate->OnGestureEvent(*event);
}
const ui::InputMethod* View::GetInputMethod() const {
@@ -1254,6 +1262,9 @@ int View::OnPerformDrop(const ui::DropTargetEvent& event) {
}
void View::OnDragDone() {
+ InkDropDelegate* ink_drop_delegate = GetInkDropDelegate();
+ if (ink_drop_delegate)
+ ink_drop_delegate->OnActionComplete();
}
// static
@@ -1519,6 +1530,12 @@ void View::ReorderChildLayers(ui::Layer* parent_layer) {
}
}
+// Animations ----------------------------------------------------------------
+
+InkDropDelegate* View::GetInkDropDelegate() const {
+ return nullptr;
+}
+
// Input -----------------------------------------------------------------------
View::DragInfo* View::GetDragInfo() {
« ui/views/animation/ink_drop_host.h ('K') | « ui/views/view.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698