| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 data.SetURL(net::FilePathToFileURL(full_path), | 356 data.SetURL(net::FilePathToFileURL(full_path), |
| 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 gfx::Screen::BadTwoWorldsContext()); |
| 367 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( | 368 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( |
| 368 data, | 369 data, |
| 369 root_window, | 370 root_window, |
| 370 location, | 371 location, |
| 371 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); | 372 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); |
| 372 #else // We are on WIN without AURA | 373 #else // We are on WIN without AURA |
| 373 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a | 374 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a |
| 374 // TabContentsViewWin, not a NativeWidgetWin. | 375 // TabContentsViewWin, not a NativeWidgetWin. |
| 375 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); | 376 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); |
| 376 // Run the drag and drop loop | 377 // Run the drag and drop loop |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 UMA_HISTOGRAM_ENUMERATION( | 479 UMA_HISTOGRAM_ENUMERATION( |
| 479 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 480 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
| 480 } | 481 } |
| 481 | 482 |
| 482 void RecordDownloadSource(ChromeDownloadSource source) { | 483 void RecordDownloadSource(ChromeDownloadSource source) { |
| 483 UMA_HISTOGRAM_ENUMERATION( | 484 UMA_HISTOGRAM_ENUMERATION( |
| 484 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); | 485 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); |
| 485 } | 486 } |
| 486 | 487 |
| 487 } // namespace download_util | 488 } // namespace download_util |
| OLD | NEW |