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

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

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | « views/controls/button/text_button.cc ('k') | views/controls/menu/menu_item_view_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/menu/menu_controller.h" 5 #include "views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/dragdrop/os_exchange_data.h" 10 #include "ui/base/dragdrop/os_exchange_data.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 event.y() - press_pt_.y())) { 452 event.y() - press_pt_.y())) {
453 MenuItemView* item = state_.item; 453 MenuItemView* item = state_.item;
454 DCHECK(item); 454 DCHECK(item);
455 // Points are in the coordinates of the submenu, need to map to that of 455 // Points are in the coordinates of the submenu, need to map to that of
456 // the selected item. Additionally source may not be the parent of 456 // the selected item. Additionally source may not be the parent of
457 // the selected item, so need to map to screen first then to item. 457 // the selected item, so need to map to screen first then to item.
458 gfx::Point press_loc(press_pt_); 458 gfx::Point press_loc(press_pt_);
459 View::ConvertPointToScreen(source->GetScrollViewContainer(), &press_loc); 459 View::ConvertPointToScreen(source->GetScrollViewContainer(), &press_loc);
460 View::ConvertPointToView(NULL, item, &press_loc); 460 View::ConvertPointToView(NULL, item, &press_loc);
461 // TODO(beng): Convert to CanvasSkia 461 // TODO(beng): Convert to CanvasSkia
462 gfx::CanvasSkia canvas(item->width(), item->height(), false); 462 gfx::CanvasSkia canvas;
463 canvas.Init(item->width(), item->height(), false);
463 item->PaintButton(&canvas, MenuItemView::PB_FOR_DRAG); 464 item->PaintButton(&canvas, MenuItemView::PB_FOR_DRAG);
464 465
465 OSExchangeData data; 466 OSExchangeData data;
466 item->GetDelegate()->WriteDragData(item, &data); 467 item->GetDelegate()->WriteDragData(item, &data);
467 drag_utils::SetDragImageOnDataObject(canvas, item->size(), press_loc, 468 drag_utils::SetDragImageOnDataObject(canvas, item->size(), press_loc,
468 &data); 469 &data);
469 StopScrolling(); 470 StopScrolling();
470 int drag_ops = item->GetDelegate()->GetDragOperations(item); 471 int drag_ops = item->GetDelegate()->GetDragOperations(item);
471 drag_in_progress_ = true; 472 drag_in_progress_ = true;
472 item->GetWidget()->RunShellDrag(NULL, data, drag_ops); 473 item->GetWidget()->RunShellDrag(NULL, data, drag_ops);
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 return; 1846 return;
1846 1847
1847 // Reset the active_mouse_view_ before sending mouse capture lost. That way if 1848 // Reset the active_mouse_view_ before sending mouse capture lost. That way if
1848 // it calls back to us, we aren't in a weird state. 1849 // it calls back to us, we aren't in a weird state.
1849 View* active_view = active_mouse_view_; 1850 View* active_view = active_mouse_view_;
1850 active_mouse_view_ = NULL; 1851 active_mouse_view_ = NULL;
1851 active_view->OnMouseCaptureLost(); 1852 active_view->OnMouseCaptureLost();
1852 } 1853 }
1853 1854
1854 } // namespace views 1855 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/text_button.cc ('k') | views/controls/menu/menu_item_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698