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

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 11368072: aura: Add flag to indicate if a drag session is started with touch or mouse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 1 month 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 | Annotate | Revision Log
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 "ui/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 item->PaintButton(canvas.get(), MenuItemView::PB_FOR_DRAG); 856 item->PaintButton(canvas.get(), MenuItemView::PB_FOR_DRAG);
857 857
858 OSExchangeData data; 858 OSExchangeData data;
859 item->GetDelegate()->WriteDragData(item, &data); 859 item->GetDelegate()->WriteDragData(item, &data);
860 drag_utils::SetDragImageOnDataObject(*canvas, item->size(), 860 drag_utils::SetDragImageOnDataObject(*canvas, item->size(),
861 press_loc.OffsetFromOrigin(), 861 press_loc.OffsetFromOrigin(),
862 &data); 862 &data);
863 StopScrolling(); 863 StopScrolling();
864 int drag_ops = item->GetDelegate()->GetDragOperations(item); 864 int drag_ops = item->GetDelegate()->GetDragOperations(item);
865 drag_in_progress_ = true; 865 drag_in_progress_ = true;
866 item->GetWidget()->RunShellDrag(NULL, data, widget_loc, drag_ops); 866 item->GetWidget()->RunShellDrag(NULL, data, widget_loc, drag_ops,
867 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
sky 2012/11/05 18:13:56 Don't we use this path for touch dragging too? I s
varunjain 2012/11/05 18:25:49 Even if we do, this should not change the behavior
867 drag_in_progress_ = false; 868 drag_in_progress_ = false;
868 869
869 if (GetActiveInstance() == this) { 870 if (GetActiveInstance() == this) {
870 if (showing_) { 871 if (showing_) {
871 // We're still showing, close all menus. 872 // We're still showing, close all menus.
872 CloseAllNestedMenus(); 873 CloseAllNestedMenus();
873 Cancel(EXIT_ALL); 874 Cancel(EXIT_ALL);
874 } // else case, drop was on us. 875 } // else case, drop was on us.
875 } // else case, someone canceled us, don't do anything 876 } // else case, someone canceled us, don't do anything
876 } 877 }
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 2137
2137 gfx::Screen* MenuController::GetScreen() { 2138 gfx::Screen* MenuController::GetScreen() {
2138 #if defined(USE_AURA) 2139 #if defined(USE_AURA)
2139 return gfx::Screen::GetScreenFor(root_window_); 2140 return gfx::Screen::GetScreenFor(root_window_);
2140 #else 2141 #else
2141 return gfx::Screen::GetNativeScreen(); 2142 return gfx::Screen::GetNativeScreen();
2142 #endif 2143 #endif
2143 } 2144 }
2144 2145
2145 } // namespace views 2146 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698