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

Side by Side Diff: ui/views/animation/ink_drop_host_view.cc

Issue 2786543002: Make updates to InkDropHighlight to pave the way for improved ink drops (Closed)
Patch Set: improved docs Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor(), 173 kInkDropSmallCornerRadius, center_point, GetInkDropBaseColor(),
174 ink_drop_visible_opacity())); 174 ink_drop_visible_opacity()));
175 return ripple; 175 return ripple;
176 } 176 }
177 177
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(gfx::SizeF(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 ink_drop_mode_ = ink_drop_mode; 188 ink_drop_mode_ = ink_drop_mode;
189 ink_drop_ = nullptr; 189 ink_drop_ = nullptr;
190 190
191 if (ink_drop_mode_ != InkDropMode::ON) 191 if (ink_drop_mode_ != InkDropMode::ON)
192 gesture_handler_ = nullptr; 192 gesture_handler_ = nullptr;
193 else if (!gesture_handler_) 193 else if (!gesture_handler_)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 std::unique_ptr<InkDropImpl> 290 std::unique_ptr<InkDropImpl>
291 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { 291 InkDropHostView::CreateDefaultFloodFillInkDropImpl() {
292 std::unique_ptr<views::InkDropImpl> ink_drop = 292 std::unique_ptr<views::InkDropImpl> ink_drop =
293 InkDropHostView::CreateDefaultInkDropImpl(); 293 InkDropHostView::CreateDefaultInkDropImpl();
294 ink_drop->SetAutoHighlightMode( 294 ink_drop->SetAutoHighlightMode(
295 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); 295 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE);
296 return ink_drop; 296 return ink_drop;
297 } 297 }
298 298
299 } // namespace views 299 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698