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

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

Issue 2876203003: Make shelf item can be dragged when context menu is opened.
Patch Set: Add widget observer for |owner_| in MenuHost. Created 3 years, 3 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 | « no previous file | ash/shelf/shelf_view.h » ('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_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/shelf/ink_drop_button_listener.h" 10 #include "ash/shelf/ink_drop_button_listener.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return; 454 return;
455 case ui::ET_GESTURE_SCROLL_UPDATE: 455 case ui::ET_GESTURE_SCROLL_UPDATE:
456 shelf_view_->PointerDraggedOnButton(this, ShelfView::TOUCH, *event); 456 shelf_view_->PointerDraggedOnButton(this, ShelfView::TOUCH, *event);
457 event->SetHandled(); 457 event->SetHandled();
458 return; 458 return;
459 case ui::ET_GESTURE_SCROLL_END: 459 case ui::ET_GESTURE_SCROLL_END:
460 case ui::ET_SCROLL_FLING_START: 460 case ui::ET_SCROLL_FLING_START:
461 shelf_view_->PointerReleasedOnButton(this, ShelfView::TOUCH, false); 461 shelf_view_->PointerReleasedOnButton(this, ShelfView::TOUCH, false);
462 event->SetHandled(); 462 event->SetHandled();
463 return; 463 return;
464 case ui::ET_GESTURE_LONG_TAP:
465 // Handle LONG_TAP to avoid opening the context menu twice.
466 event->SetHandled();
467 return;
464 default: 468 default:
465 return Button::OnGestureEvent(event); 469 return Button::OnGestureEvent(event);
466 } 470 }
467 } 471 }
468 472
469 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const { 473 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const {
470 return base::MakeUnique<views::SquareInkDropRipple>( 474 return base::MakeUnique<views::SquareInkDropRipple>(
471 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), 475 gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
472 kInkDropLargeCornerRadius, 476 kInkDropLargeCornerRadius,
473 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), 477 gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf 509 icon_view_->SetHorizontalAlignment(is_horizontal_shelf
506 ? views::ImageView::CENTER 510 ? views::ImageView::CENTER
507 : views::ImageView::LEADING); 511 : views::ImageView::LEADING);
508 icon_view_->SetVerticalAlignment(is_horizontal_shelf 512 icon_view_->SetVerticalAlignment(is_horizontal_shelf
509 ? views::ImageView::LEADING 513 ? views::ImageView::LEADING
510 : views::ImageView::CENTER); 514 : views::ImageView::CENTER);
511 SchedulePaint(); 515 SchedulePaint();
512 } 516 }
513 517
514 } // namespace ash 518 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698