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/plugins/plugin_installer.h" | 5 #include "chrome/browser/plugins/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 scoped_ptr<net::URLRequest> request( | 47 scoped_ptr<net::URLRequest> request( |
48 resource_context->GetRequestContext()->CreateRequest(url, NULL)); | 48 resource_context->GetRequestContext()->CreateRequest(url, NULL)); |
49 net::Error error = rdh->BeginDownload( | 49 net::Error error = rdh->BeginDownload( |
50 request.Pass(), | 50 request.Pass(), |
51 false, // is_content_initiated | 51 false, // is_content_initiated |
52 resource_context, | 52 resource_context, |
53 render_process_host_id, | 53 render_process_host_id, |
54 render_view_host_routing_id, | 54 render_view_host_routing_id, |
55 true, // prefer_cache | 55 true, // prefer_cache |
56 scoped_ptr<content::DownloadSaveInfo>(new content::DownloadSaveInfo()), | 56 scoped_ptr<content::DownloadSaveInfo>(new content::DownloadSaveInfo()), |
| 57 "", |
| 58 "", |
| 59 content::DownloadId::Invalid(), |
57 callback); | 60 callback); |
58 | 61 |
59 if (error != net::OK) { | 62 if (error != net::OK) { |
60 BrowserThread::PostTask( | 63 BrowserThread::PostTask( |
61 BrowserThread::UI, FROM_HERE, | 64 BrowserThread::UI, FROM_HERE, |
62 base::Bind(callback, static_cast<DownloadItem*>(NULL), error)); | 65 base::Bind(callback, static_cast<DownloadItem*>(NULL), error)); |
63 } | 66 } |
64 } | 67 } |
65 | 68 |
66 } // namespace | 69 } // namespace |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 185 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
183 state_ = INSTALLER_STATE_IDLE; | 186 state_ = INSTALLER_STATE_IDLE; |
184 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); | 187 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); |
185 } | 188 } |
186 | 189 |
187 void PluginInstaller::DownloadCancelled() { | 190 void PluginInstaller::DownloadCancelled() { |
188 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 191 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
189 state_ = INSTALLER_STATE_IDLE; | 192 state_ = INSTALLER_STATE_IDLE; |
190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); | 193 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); |
191 } | 194 } |
OLD | NEW |