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

Side by Side Diff: chrome/browser/download/download_util.cc

Issue 10855159: Support Drag and Drop across displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDropTrackerTest on Win Created 8 years, 4 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
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 // Download utility implementation 5 // Download utility implementation
6 6
7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
8 8
9 #include "chrome/browser/download/download_util.h" 9 #include "chrome/browser/download/download_util.h"
10 10
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 download->GetFileNameToReportUser().LossyDisplayName()); 357 download->GetFileNameToReportUser().LossyDisplayName());
358 } 358 }
359 359
360 #if !defined(TOOLKIT_GTK) 360 #if !defined(TOOLKIT_GTK)
361 #if defined(USE_AURA) 361 #if defined(USE_AURA)
362 aura::RootWindow* root_window = view->GetRootWindow(); 362 aura::RootWindow* root_window = view->GetRootWindow();
363 if (!root_window || !aura::client::GetDragDropClient(root_window)) 363 if (!root_window || !aura::client::GetDragDropClient(root_window))
364 return; 364 return;
365 365
366 gfx::Point location = gfx::Screen::GetCursorScreenPoint(); 366 gfx::Point location = gfx::Screen::GetCursorScreenPoint();
367 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(data, location, 367 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
368 data,
369 root_window,
370 location,
368 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); 371 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK);
369 #else // We are on WIN without AURA 372 #else // We are on WIN without AURA
370 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a 373 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a
371 // TabContentsViewWin, not a NativeWidgetWin. 374 // TabContentsViewWin, not a NativeWidgetWin.
372 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); 375 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
373 // Run the drag and drop loop 376 // Run the drag and drop loop
374 DWORD effects; 377 DWORD effects;
375 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), 378 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
376 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); 379 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
377 #endif 380 #endif
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 UMA_HISTOGRAM_ENUMERATION( 478 UMA_HISTOGRAM_ENUMERATION(
476 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); 479 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
477 } 480 }
478 481
479 void RecordDownloadSource(ChromeDownloadSource source) { 482 void RecordDownloadSource(ChromeDownloadSource source) {
480 UMA_HISTOGRAM_ENUMERATION( 483 UMA_HISTOGRAM_ENUMERATION(
481 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); 484 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY);
482 } 485 }
483 486
484 } // namespace download_util 487 } // namespace download_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698