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 #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 Loading... | |
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 /* from_web */, | |
darin (slow to review)
2012/05/12 18:23:08
nit: use C++ style comment
false, // from_web
Randy Smith (Not in Mondays)
2012/05/12 19:56:37
Done.
| |
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 Loading... | |
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 } |
OLD | NEW |