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

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

Issue 328993002: Ensure that the size passed down to the SetDragImageOnDataObject function called from drag_utils::S… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed parentheses and fixed alignment Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/button_drag_utils.cc ('k') | ui/views/controls/textfield/textfield.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 (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/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 View::ConvertPointToScreen(source->GetScrollViewContainer(), &press_loc); 957 View::ConvertPointToScreen(source->GetScrollViewContainer(), &press_loc);
958 View::ConvertPointFromScreen(item, &press_loc); 958 View::ConvertPointFromScreen(item, &press_loc);
959 gfx::Point widget_loc(press_loc); 959 gfx::Point widget_loc(press_loc);
960 View::ConvertPointToWidget(item, &widget_loc); 960 View::ConvertPointToWidget(item, &widget_loc);
961 scoped_ptr<gfx::Canvas> canvas(GetCanvasForDragImage( 961 scoped_ptr<gfx::Canvas> canvas(GetCanvasForDragImage(
962 source->GetWidget(), gfx::Size(item->width(), item->height()))); 962 source->GetWidget(), gfx::Size(item->width(), item->height())));
963 item->PaintButton(canvas.get(), MenuItemView::PB_FOR_DRAG); 963 item->PaintButton(canvas.get(), MenuItemView::PB_FOR_DRAG);
964 964
965 OSExchangeData data; 965 OSExchangeData data;
966 item->GetDelegate()->WriteDragData(item, &data); 966 item->GetDelegate()->WriteDragData(item, &data);
967 drag_utils::SetDragImageOnDataObject(*canvas, item->size(), 967 drag_utils::SetDragImageOnDataObject(*canvas,
968 press_loc.OffsetFromOrigin(), 968 press_loc.OffsetFromOrigin(),
969 &data); 969 &data);
970 StopScrolling(); 970 StopScrolling();
971 int drag_ops = item->GetDelegate()->GetDragOperations(item); 971 int drag_ops = item->GetDelegate()->GetDragOperations(item);
972 drag_in_progress_ = true; 972 drag_in_progress_ = true;
973 // TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below. 973 // TODO(varunjain): Properly determine and send DRAG_EVENT_SOURCE below.
974 item->GetWidget()->RunShellDrag(NULL, data, widget_loc, drag_ops, 974 item->GetWidget()->RunShellDrag(NULL, data, widget_loc, drag_ops,
975 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE); 975 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
976 drag_in_progress_ = false; 976 drag_in_progress_ = false;
977 977
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 } 2287 }
2288 } 2288 }
2289 2289
2290 gfx::Screen* MenuController::GetScreen() { 2290 gfx::Screen* MenuController::GetScreen() {
2291 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL; 2291 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL;
2292 return root ? gfx::Screen::GetScreenFor(root->GetNativeView()) 2292 return root ? gfx::Screen::GetScreenFor(root->GetNativeView())
2293 : gfx::Screen::GetNativeScreen(); 2293 : gfx::Screen::GetNativeScreen();
2294 } 2294 }
2295 2295
2296 } // namespace views 2296 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/button_drag_utils.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698