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

Side by Side Diff: chrome/browser/plugin_installer.cc

Issue 10381122: Add flag to specify if explicitly requested download is from web. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR and integrated into DownloadUrlParams. Created 8 years, 7 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/plugin_installer.h" 5 #include "chrome/browser/plugin_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 26 matching lines...) Expand all
37 content::ResourceContext* resource_context, 37 content::ResourceContext* resource_context,
38 int render_process_host_id, 38 int render_process_host_id,
39 int render_view_host_routing_id, 39 int render_view_host_routing_id,
40 const ResourceDispatcherHost::DownloadStartedCallback& callback) { 40 const ResourceDispatcherHost::DownloadStartedCallback& callback) {
41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
42 42
43 ResourceDispatcherHost* rdh = ResourceDispatcherHost::Get(); 43 ResourceDispatcherHost* rdh = ResourceDispatcherHost::Get();
44 scoped_ptr<net::URLRequest> request(new net::URLRequest(url, NULL)); 44 scoped_ptr<net::URLRequest> request(new net::URLRequest(url, NULL));
45 net::Error error = rdh->BeginDownload( 45 net::Error error = rdh->BeginDownload(
46 request.Pass(), 46 request.Pass(),
47 false, // is_content_initiated
47 resource_context, 48 resource_context,
48 render_process_host_id, 49 render_process_host_id,
49 render_view_host_routing_id, 50 render_view_host_routing_id,
50 true, // prefer_cache 51 true, // prefer_cache
51 content::DownloadSaveInfo(), 52 content::DownloadSaveInfo(),
52 callback); 53 callback);
53 54
54 if (error != net::OK) { 55 if (error != net::OK) {
55 BrowserThread::PostTask( 56 BrowserThread::PostTask(
56 BrowserThread::UI, FROM_HERE, 57 BrowserThread::UI, FROM_HERE,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DCHECK(state_ == kStateDownloading); 191 DCHECK(state_ == kStateDownloading);
191 state_ = kStateIdle; 192 state_ = kStateIdle;
192 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); 193 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg));
193 } 194 }
194 195
195 void PluginInstaller::DownloadCancelled() { 196 void PluginInstaller::DownloadCancelled() {
196 DCHECK(state_ == kStateDownloading); 197 DCHECK(state_ == kStateDownloading);
197 state_ = kStateIdle; 198 state_ = kStateIdle;
198 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); 199 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled());
199 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698