Chromium Code Reviews| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
| 9 #include "ui/events/scoped_target_handler.h" | 9 #include "ui/events/scoped_target_handler.h" |
| 10 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 std::unique_ptr<InkDropHighlight> | 178 std::unique_ptr<InkDropHighlight> |
| 179 InkDropHostView::CreateDefaultInkDropHighlight(const gfx::PointF& center_point, | 179 InkDropHostView::CreateDefaultInkDropHighlight(const gfx::PointF& center_point, |
| 180 const gfx::Size& size) const { | 180 const gfx::Size& size) const { |
| 181 std::unique_ptr<InkDropHighlight> highlight(new InkDropHighlight( | 181 std::unique_ptr<InkDropHighlight> highlight(new InkDropHighlight( |
| 182 size, kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor())); | 182 size, kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor())); |
| 183 highlight->set_explode_size(CalculateLargeInkDropSize(size)); | 183 highlight->set_explode_size(CalculateLargeInkDropSize(size)); |
| 184 return highlight; | 184 return highlight; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void InkDropHostView::SetInkDropMode(InkDropMode ink_drop_mode) { | 187 void InkDropHostView::SetInkDropMode(InkDropMode ink_drop_mode) { |
| 188 if (ink_drop_mode == ink_drop_mode_) | |
|
Evan Stade
2017/03/17 13:54:44
this doesn't seem like a bad thing but could it ha
Bret
2017/03/17 23:41:41
I didn't see any trouble with this when I was test
| |
| 189 return; | |
| 190 | |
| 188 ink_drop_mode_ = ink_drop_mode; | 191 ink_drop_mode_ = ink_drop_mode; |
| 189 ink_drop_ = nullptr; | 192 ink_drop_ = nullptr; |
| 190 | 193 |
| 191 if (ink_drop_mode_ != InkDropMode::ON) | 194 if (ink_drop_mode_ != InkDropMode::ON) |
| 192 gesture_handler_ = nullptr; | 195 gesture_handler_ = nullptr; |
| 193 else if (!gesture_handler_) | 196 else if (!gesture_handler_) |
| 194 gesture_handler_ = base::MakeUnique<InkDropGestureHandler>(this); | 197 gesture_handler_ = base::MakeUnique<InkDropGestureHandler>(this); |
| 195 } | 198 } |
| 196 | 199 |
| 197 gfx::Point InkDropHostView::GetInkDropCenterBasedOnLastEvent() const { | 200 gfx::Point InkDropHostView::GetInkDropCenterBasedOnLastEvent() const { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 std::unique_ptr<InkDropImpl> | 293 std::unique_ptr<InkDropImpl> |
| 291 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { | 294 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { |
| 292 std::unique_ptr<views::InkDropImpl> ink_drop = | 295 std::unique_ptr<views::InkDropImpl> ink_drop = |
| 293 InkDropHostView::CreateDefaultInkDropImpl(); | 296 InkDropHostView::CreateDefaultInkDropImpl(); |
| 294 ink_drop->SetAutoHighlightMode( | 297 ink_drop->SetAutoHighlightMode( |
| 295 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); | 298 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); |
| 296 return ink_drop; | 299 return ink_drop; |
| 297 } | 300 } |
| 298 | 301 |
| 299 } // namespace views | 302 } // namespace views |
| OLD | NEW |