| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 download->GetFileNameToReportUser().LossyDisplayName()); | 379 download->GetFileNameToReportUser().LossyDisplayName()); |
| 380 } | 380 } |
| 381 | 381 |
| 382 #if !defined(TOOLKIT_GTK) | 382 #if !defined(TOOLKIT_GTK) |
| 383 #if defined(USE_AURA) | 383 #if defined(USE_AURA) |
| 384 aura::RootWindow* root_window = view->GetRootWindow(); | 384 aura::RootWindow* root_window = view->GetRootWindow(); |
| 385 if (!root_window || !aura::client::GetDragDropClient(root_window)) | 385 if (!root_window || !aura::client::GetDragDropClient(root_window)) |
| 386 return; | 386 return; |
| 387 | 387 |
| 388 gfx::Point location = gfx::Screen::GetCursorScreenPoint(); | 388 gfx::Point location = gfx::Screen::GetCursorScreenPoint(); |
| 389 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(data, location, | 389 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( |
| 390 data, |
| 391 root_window, |
| 392 location, |
| 390 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); | 393 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); |
| 391 #else // We are on WIN without AURA | 394 #else // We are on WIN without AURA |
| 392 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a | 395 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a |
| 393 // TabContentsViewWin, not a NativeWidgetWin. | 396 // TabContentsViewWin, not a NativeWidgetWin. |
| 394 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); | 397 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); |
| 395 // Run the drag and drop loop | 398 // Run the drag and drop loop |
| 396 DWORD effects; | 399 DWORD effects; |
| 397 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), | 400 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), |
| 398 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); | 401 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); |
| 399 #endif | 402 #endif |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 UMA_HISTOGRAM_ENUMERATION( | 582 UMA_HISTOGRAM_ENUMERATION( |
| 580 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 583 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
| 581 } | 584 } |
| 582 | 585 |
| 583 void RecordDownloadSource(ChromeDownloadSource source) { | 586 void RecordDownloadSource(ChromeDownloadSource source) { |
| 584 UMA_HISTOGRAM_ENUMERATION( | 587 UMA_HISTOGRAM_ENUMERATION( |
| 585 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); | 588 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); |
| 586 } | 589 } |
| 587 | 590 |
| 588 } // namespace download_util | 591 } // namespace download_util |
| OLD | NEW |