OLD | NEW |
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 data.SetURL(net::FilePathToFileURL(full_path), | 352 data.SetURL(net::FilePathToFileURL(full_path), |
353 download->GetFileNameToReportUser().LossyDisplayName()); | 353 download->GetFileNameToReportUser().LossyDisplayName()); |
354 } | 354 } |
355 | 355 |
356 #if !defined(TOOLKIT_GTK) | 356 #if !defined(TOOLKIT_GTK) |
357 #if defined(USE_AURA) | 357 #if defined(USE_AURA) |
358 aura::RootWindow* root_window = view->GetRootWindow(); | 358 aura::RootWindow* root_window = view->GetRootWindow(); |
359 if (!root_window || !aura::client::GetDragDropClient(root_window)) | 359 if (!root_window || !aura::client::GetDragDropClient(root_window)) |
360 return; | 360 return; |
361 | 361 |
362 gfx::Point location = gfx::Screen::GetCursorScreenPoint(); | 362 gfx::Point location = gfx::Screen::GetScreenFor(view)->GetCursorScreenPoint(); |
363 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( | 363 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( |
364 data, | 364 data, |
365 root_window, | 365 root_window, |
366 location, | 366 location, |
367 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); | 367 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); |
368 #else // We are on WIN without AURA | 368 #else // We are on WIN without AURA |
369 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a | 369 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a |
370 // TabContentsViewWin, not a NativeWidgetWin. | 370 // TabContentsViewWin, not a NativeWidgetWin. |
371 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); | 371 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); |
372 // Run the drag and drop loop | 372 // Run the drag and drop loop |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 UMA_HISTOGRAM_ENUMERATION( | 474 UMA_HISTOGRAM_ENUMERATION( |
475 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 475 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
476 } | 476 } |
477 | 477 |
478 void RecordDownloadSource(ChromeDownloadSource source) { | 478 void RecordDownloadSource(ChromeDownloadSource source) { |
479 UMA_HISTOGRAM_ENUMERATION( | 479 UMA_HISTOGRAM_ENUMERATION( |
480 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); | 480 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); |
481 } | 481 } |
482 | 482 |
483 } // namespace download_util | 483 } // namespace download_util |
OLD | NEW |