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

Side by Side Diff: ash/shelf/shelf_button.cc

Issue 2042073002: Centered flood fill style ink drop ripples on mouse/touch points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed LocatedEvent::AsLocatedIfLocatedEvent() as FromIfValid(). Created 4 years, 6 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
« no previous file with comments | « ash/shelf/shelf_button.h ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/shelf/shelf_button.h" 5 #include "ash/shelf/shelf_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 Layout(); 338 Layout();
339 if (state & STATE_ATTENTION) 339 if (state & STATE_ATTENTION)
340 bar_->ShowAttention(false); 340 bar_->ShowAttention(false);
341 } 341 }
342 } 342 }
343 343
344 gfx::Rect ShelfButton::GetIconBounds() const { 344 gfx::Rect ShelfButton::GetIconBounds() const {
345 return icon_view_->bounds(); 345 return icon_view_->bounds();
346 } 346 }
347 347
348 void ShelfButton::OnDragStarted() { 348 void ShelfButton::OnDragStarted(const ui::LocatedEvent* event) {
349 AnimateInkDrop(views::InkDropState::HIDDEN); 349 AnimateInkDrop(views::InkDropState::HIDDEN, event);
350 } 350 }
351 351
352 void ShelfButton::ShowContextMenu(const gfx::Point& p, 352 void ShelfButton::ShowContextMenu(const gfx::Point& p,
353 ui::MenuSourceType source_type) { 353 ui::MenuSourceType source_type) {
354 if (!context_menu_controller()) 354 if (!context_menu_controller())
355 return; 355 return;
356 356
357 bool destroyed = false; 357 bool destroyed = false;
358 destroyed_flag_ = &destroyed; 358 destroyed_flag_ = &destroyed;
359 359
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 default: 496 default:
497 return CustomButton::OnGestureEvent(event); 497 return CustomButton::OnGestureEvent(event);
498 } 498 }
499 } 499 }
500 500
501 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const { 501 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const {
502 return base::WrapUnique(new views::SquareInkDropRipple( 502 return base::WrapUnique(new views::SquareInkDropRipple(
503 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), 503 gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
504 kInkDropLargeCornerRadius, 504 kInkDropLargeCornerRadius,
505 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), 505 gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
506 kInkDropSmallCornerRadius, GetInkDropCenter(), GetInkDropBaseColor())); 506 kInkDropSmallCornerRadius, GetLocalBounds().CenterPoint(),
507 GetInkDropBaseColor()));
507 } 508 }
508 509
509 bool ShelfButton::ShouldEnterPushedState(const ui::Event& event) { 510 bool ShelfButton::ShouldEnterPushedState(const ui::Event& event) {
510 if (!shelf_view_->ShouldEventActivateButton(this, event)) 511 if (!shelf_view_->ShouldEventActivateButton(this, event))
511 return false; 512 return false;
512 513
513 return CustomButton::ShouldEnterPushedState(event); 514 return CustomButton::ShouldEnterPushedState(event);
514 } 515 }
515 516
516 bool ShelfButton::ShouldShowInkDropHighlight() const { 517 bool ShelfButton::ShouldShowInkDropHighlight() const {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 views::ImageView::TRAILING)); 573 views::ImageView::TRAILING));
573 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( 574 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment(
574 views::ImageView::TRAILING, views::ImageView::CENTER, 575 views::ImageView::TRAILING, views::ImageView::CENTER,
575 views::ImageView::CENTER)); 576 views::ImageView::CENTER));
576 bar_->SchedulePaint(); 577 bar_->SchedulePaint();
577 } 578 }
578 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); 579 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL);
579 } 580 }
580 581
581 } // namespace ash 582 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_button.h ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698