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

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

Issue 2876203003: Make shelf item can be dragged when context menu is opened.
Patch Set: Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 // Ignore if this is a repost event on the last pressed shelf item. 635 // Ignore if this is a repost event on the last pressed shelf item.
636 int index = view_model_->GetIndexOfView(view); 636 int index = view_model_->GetIndexOfView(view);
637 if (index == -1) 637 if (index == -1)
638 return false; 638 return false;
639 return !IsRepostEvent(event) || last_pressed_index_ != index; 639 return !IsRepostEvent(event) || last_pressed_index_ != index;
640 } 640 }
641 641
642 void ShelfView::PointerPressedOnButton(views::View* view, 642 void ShelfView::PointerPressedOnButton(views::View* view,
643 Pointer pointer, 643 Pointer pointer,
644 const ui::LocatedEvent& event) { 644 const ui::LocatedEvent& event) {
645 if (IsShowingMenu()) {
646 launcher_menu_runner_->Cancel();
647 }
645 if (drag_view_) 648 if (drag_view_)
646 return; 649 return;
647 650
648 int index = view_model_->GetIndexOfView(view); 651 int index = view_model_->GetIndexOfView(view);
649 if (index == -1 || view_model_->view_size() <= 1) 652 if (index == -1 || view_model_->view_size() <= 1)
650 return; // View is being deleted, ignore request. 653 return; // View is being deleted, ignore request.
651 654
652 if (view == GetAppListButton()) 655 if (view == GetAppListButton())
653 return; // View is not draggable, ignore request. 656 return; // View is not draggable, ignore request.
654 657
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 if (pointer == TOUCH && 1825 if (pointer == TOUCH &&
1823 (base::TimeTicks::Now() - touch_press_time_) < 1826 (base::TimeTicks::Now() - touch_press_time_) <
1824 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { 1827 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) {
1825 return false; 1828 return false;
1826 } 1829 }
1827 1830
1828 return true; 1831 return true;
1829 } 1832 }
1830 1833
1831 } // namespace ash 1834 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698