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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 23271005: Move DragDownload() out of download_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drag_download_item Created 7 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 #include "chrome/browser/extensions/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cctype> 8 #include <cctype>
9 #include <iterator> 9 #include <iterator>
10 #include <set> 10 #include <set>
(...skipping 19 matching lines...) Expand all
30 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
31 #include "chrome/browser/chrome_notification_types.h" 31 #include "chrome/browser/chrome_notification_types.h"
32 #include "chrome/browser/download/download_danger_prompt.h" 32 #include "chrome/browser/download/download_danger_prompt.h"
33 #include "chrome/browser/download/download_file_icon_extractor.h" 33 #include "chrome/browser/download/download_file_icon_extractor.h"
34 #include "chrome/browser/download/download_prefs.h" 34 #include "chrome/browser/download/download_prefs.h"
35 #include "chrome/browser/download/download_query.h" 35 #include "chrome/browser/download/download_query.h"
36 #include "chrome/browser/download/download_service.h" 36 #include "chrome/browser/download/download_service.h"
37 #include "chrome/browser/download/download_service_factory.h" 37 #include "chrome/browser/download/download_service_factory.h"
38 #include "chrome/browser/download/download_shelf.h" 38 #include "chrome/browser/download/download_shelf.h"
39 #include "chrome/browser/download/download_stats.h" 39 #include "chrome/browser/download/download_stats.h"
40 #include "chrome/browser/download/download_util.h" 40 #include "chrome/browser/download/drag_download_item.h"
41 #include "chrome/browser/extensions/event_router.h" 41 #include "chrome/browser/extensions/event_router.h"
42 #include "chrome/browser/extensions/extension_function_dispatcher.h" 42 #include "chrome/browser/extensions/extension_function_dispatcher.h"
43 #include "chrome/browser/extensions/extension_info_map.h" 43 #include "chrome/browser/extensions/extension_info_map.h"
44 #include "chrome/browser/extensions/extension_prefs.h" 44 #include "chrome/browser/extensions/extension_prefs.h"
45 #include "chrome/browser/extensions/extension_service.h" 45 #include "chrome/browser/extensions/extension_service.h"
46 #include "chrome/browser/extensions/extension_system.h" 46 #include "chrome/browser/extensions/extension_system.h"
47 #include "chrome/browser/extensions/extension_warning_service.h" 47 #include "chrome/browser/extensions/extension_warning_service.h"
48 #include "chrome/browser/extensions/extension_warning_set.h" 48 #include "chrome/browser/extensions/extension_warning_set.h"
49 #include "chrome/browser/icon_loader.h" 49 #include "chrome/browser/icon_loader.h"
50 #include "chrome/browser/icon_manager.h" 50 #include "chrome/browser/icon_manager.h"
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 Fault(!web_contents, errors::kInvisibleContext, &error_)) 1363 Fault(!web_contents, errors::kInvisibleContext, &error_))
1364 return false; 1364 return false;
1365 RecordApiFunctions(DOWNLOADS_FUNCTION_DRAG); 1365 RecordApiFunctions(DOWNLOADS_FUNCTION_DRAG);
1366 gfx::Image* icon = g_browser_process->icon_manager()->LookupIconFromFilepath( 1366 gfx::Image* icon = g_browser_process->icon_manager()->LookupIconFromFilepath(
1367 download_item->GetTargetFilePath(), IconLoader::NORMAL); 1367 download_item->GetTargetFilePath(), IconLoader::NORMAL);
1368 gfx::NativeView view = web_contents->GetView()->GetNativeView(); 1368 gfx::NativeView view = web_contents->GetView()->GetNativeView();
1369 { 1369 {
1370 // Enable nested tasks during DnD, while |DragDownload()| blocks. 1370 // Enable nested tasks during DnD, while |DragDownload()| blocks.
1371 base::MessageLoop::ScopedNestableTaskAllower allow( 1371 base::MessageLoop::ScopedNestableTaskAllower allow(
1372 base::MessageLoop::current()); 1372 base::MessageLoop::current());
1373 download_util::DragDownload(download_item, icon, view); 1373 DragDownloadItem(download_item, icon, view);
1374 } 1374 }
1375 return true; 1375 return true;
1376 } 1376 }
1377 1377
1378 DownloadsSetShelfEnabledFunction::DownloadsSetShelfEnabledFunction() {} 1378 DownloadsSetShelfEnabledFunction::DownloadsSetShelfEnabledFunction() {}
1379 1379
1380 DownloadsSetShelfEnabledFunction::~DownloadsSetShelfEnabledFunction() {} 1380 DownloadsSetShelfEnabledFunction::~DownloadsSetShelfEnabledFunction() {}
1381 1381
1382 bool DownloadsSetShelfEnabledFunction::RunImpl() { 1382 bool DownloadsSetShelfEnabledFunction::RunImpl() {
1383 scoped_ptr<downloads::SetShelfEnabled::Params> params( 1383 scoped_ptr<downloads::SetShelfEnabled::Params> params(
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 extensions::UnloadedExtensionInfo* unloaded = 1871 extensions::UnloadedExtensionInfo* unloaded =
1872 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); 1872 content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
1873 std::set<const extensions::Extension*>::iterator iter = 1873 std::set<const extensions::Extension*>::iterator iter =
1874 shelf_disabling_extensions_.find(unloaded->extension); 1874 shelf_disabling_extensions_.find(unloaded->extension);
1875 if (iter != shelf_disabling_extensions_.end()) 1875 if (iter != shelf_disabling_extensions_.end())
1876 shelf_disabling_extensions_.erase(iter); 1876 shelf_disabling_extensions_.erase(iter);
1877 break; 1877 break;
1878 } 1878 }
1879 } 1879 }
1880 } 1880 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698