OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/animation/ink_drop_host_view.h" | 5 #include "ui/views/animation/ink_drop_host_view.h" |
6 | 6 |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/events/scoped_target_handler.h" | 8 #include "ui/events/scoped_target_handler.h" |
9 #include "ui/gfx/color_palette.h" | 9 #include "ui/gfx/color_palette.h" |
10 #include "ui/gfx/geometry/size_conversions.h" | 10 #include "ui/gfx/geometry/size_conversions.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 SkColor InkDropHostView::GetInkDropBaseColor() const { | 214 SkColor InkDropHostView::GetInkDropBaseColor() const { |
215 NOTREACHED(); | 215 NOTREACHED(); |
216 return gfx::kPlaceholderColor; | 216 return gfx::kPlaceholderColor; |
217 } | 217 } |
218 | 218 |
219 bool InkDropHostView::ShouldShowInkDropForFocus() const { | 219 bool InkDropHostView::ShouldShowInkDropForFocus() const { |
220 return false; | 220 return false; |
221 } | 221 } |
222 | 222 |
223 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { | 223 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { |
| 224 bool handles_gesture_event = has_an_ink_drop; |
| 225 SetHasInkDrop(has_an_ink_drop, handles_gesture_event); |
| 226 } |
| 227 |
| 228 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop, |
| 229 bool handles_gesture_event) { |
224 if (has_an_ink_drop) { | 230 if (has_an_ink_drop) { |
225 ink_drop_.reset(new InkDropImpl(this)); | 231 ink_drop_.reset(new InkDropImpl(this)); |
226 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); | 232 if (handles_gesture_event) |
| 233 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); |
| 234 else |
| 235 gesture_handler_.reset(); |
227 } else { | 236 } else { |
| 237 DCHECK(!handles_gesture_event); |
228 gesture_handler_.reset(); | 238 gesture_handler_.reset(); |
229 ink_drop_.reset(new InkDropStub()); | 239 ink_drop_.reset(new InkDropStub()); |
230 } | 240 } |
231 } | 241 } |
232 | 242 |
233 } // namespace views | 243 } // namespace views |
OLD | NEW |