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

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
« no previous file with comments | « ui/base/dragdrop/drag_drop_types.h ('k') | ui/views/drag_utils.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 (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 // TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below.
867 item->GetWidget()->RunShellDrag(NULL, data, widget_loc, drag_ops,
868 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
867 drag_in_progress_ = false; 869 drag_in_progress_ = false;
868 870
869 if (GetActiveInstance() == this) { 871 if (GetActiveInstance() == this) {
870 if (showing_) { 872 if (showing_) {
871 // We're still showing, close all menus. 873 // We're still showing, close all menus.
872 CloseAllNestedMenus(); 874 CloseAllNestedMenus();
873 Cancel(EXIT_ALL); 875 Cancel(EXIT_ALL);
874 } // else case, drop was on us. 876 } // else case, drop was on us.
875 } // else case, someone canceled us, don't do anything 877 } // else case, someone canceled us, don't do anything
876 } 878 }
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 2138
2137 gfx::Screen* MenuController::GetScreen() { 2139 gfx::Screen* MenuController::GetScreen() {
2138 #if defined(USE_AURA) 2140 #if defined(USE_AURA)
2139 return gfx::Screen::GetScreenFor(root_window_); 2141 return gfx::Screen::GetScreenFor(root_window_);
2140 #else 2142 #else
2141 return gfx::Screen::GetNativeScreen(); 2143 return gfx::Screen::GetNativeScreen();
2142 #endif 2144 #endif
2143 } 2145 }
2144 2146
2145 } // namespace views 2147 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/dragdrop/drag_drop_types.h ('k') | ui/views/drag_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698