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

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

Issue 12211049: Removing base::ThreadRestrictions::ScopedAllowIO from icon_manager_linux.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presubmit. Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/icon_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 EXTENSION_FUNCTION_VALIDATE(params.get()); 1111 EXTENSION_FUNCTION_VALIDATE(params.get());
1112 DownloadItem* download_item = GetDownload( 1112 DownloadItem* download_item = GetDownload(
1113 profile(), include_incognito(), params->download_id); 1113 profile(), include_incognito(), params->download_id);
1114 content::WebContents* web_contents = 1114 content::WebContents* web_contents =
1115 dispatcher()->delegate()->GetAssociatedWebContents(); 1115 dispatcher()->delegate()->GetAssociatedWebContents();
1116 if (!download_item || !web_contents) { 1116 if (!download_item || !web_contents) {
1117 error_ = download_extension_errors::kInvalidOperationError; 1117 error_ = download_extension_errors::kInvalidOperationError;
1118 return false; 1118 return false;
1119 } 1119 }
1120 RecordApiFunctions(DOWNLOADS_FUNCTION_DRAG); 1120 RecordApiFunctions(DOWNLOADS_FUNCTION_DRAG);
1121 gfx::Image* icon = g_browser_process->icon_manager()->LookupIcon( 1121 gfx::Image* icon = g_browser_process->icon_manager()->LookupIconFromFilepath(
1122 download_item->GetUserVerifiedFilePath(), IconLoader::NORMAL); 1122 download_item->GetUserVerifiedFilePath(), IconLoader::NORMAL);
1123 gfx::NativeView view = web_contents->GetView()->GetNativeView(); 1123 gfx::NativeView view = web_contents->GetView()->GetNativeView();
1124 { 1124 {
1125 // Enable nested tasks during DnD, while |DragDownload()| blocks. 1125 // Enable nested tasks during DnD, while |DragDownload()| blocks.
1126 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); 1126 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
1127 download_util::DragDownload(download_item, icon, view); 1127 download_util::DragDownload(download_item, icon, view);
1128 } 1128 }
1129 return true; 1129 return true;
1130 } 1130 }
1131 1131
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 DownloadsNotificationSource notification_source; 1444 DownloadsNotificationSource notification_source;
1445 notification_source.event_name = event_name; 1445 notification_source.event_name = event_name;
1446 notification_source.profile = profile_; 1446 notification_source.profile = profile_;
1447 content::Source<DownloadsNotificationSource> content_source( 1447 content::Source<DownloadsNotificationSource> content_source(
1448 &notification_source); 1448 &notification_source);
1449 content::NotificationService::current()->Notify( 1449 content::NotificationService::current()->Notify(
1450 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, 1450 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
1451 content_source, 1451 content_source,
1452 content::Details<std::string>(&json_args)); 1452 content::Details<std::string>(&json_args));
1453 } 1453 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/icon_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698