| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 SkColor InkDropHostView::GetInkDropBaseColor() const { | 236 SkColor InkDropHostView::GetInkDropBaseColor() const { |
| 237 NOTREACHED(); | 237 NOTREACHED(); |
| 238 return gfx::kPlaceholderColor; | 238 return gfx::kPlaceholderColor; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool InkDropHostView::ShouldShowInkDropForFocus() const { | 241 bool InkDropHostView::ShouldShowInkDropForFocus() const { |
| 242 return false; | 242 return false; |
| 243 } | 243 } |
| 244 | 244 |
| 245 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { | 245 void InkDropHostView::SetInkDropMode(InkDropMode ink_drop_mode) { |
| 246 if (has_an_ink_drop) { | 246 if (ink_drop_mode == NO_INK_DROP) |
| 247 ink_drop_.reset(new InkDropStub()); |
| 248 else |
| 247 ink_drop_.reset(new InkDropImpl(this)); | 249 ink_drop_.reset(new InkDropImpl(this)); |
| 248 if (!gesture_handler_) | 250 |
| 251 if (ink_drop_mode == INK_DROP_WITH_GESTURE_HANDLING) { |
| 252 if (gesture_handler_) |
| 253 gesture_handler_->SetInkDrop(ink_drop_.get()); |
| 254 else |
| 249 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); | 255 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); |
| 250 else | |
| 251 gesture_handler_->SetInkDrop(ink_drop_.get()); | |
| 252 } else { | 256 } else { |
| 253 gesture_handler_.reset(); | 257 gesture_handler_.reset(); |
| 254 ink_drop_.reset(new InkDropStub()); | |
| 255 } | 258 } |
| 256 } | 259 } |
| 257 | 260 |
| 258 } // namespace views | 261 } // namespace views |
| OLD | NEW |