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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 base::Bind(callback, content::DownloadId::Invalid(), error)); | 57 base::Bind(callback, content::DownloadId::Invalid(), error)); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 } | 61 } |
62 | 62 |
63 PluginInstaller::PluginInstaller(const std::string& identifier, | 63 PluginInstaller::PluginInstaller(const std::string& identifier, |
64 const GURL& plugin_url, | 64 const GURL& plugin_url, |
65 const GURL& help_url, | 65 const GURL& help_url, |
66 const string16& name, | 66 const string16& name, |
67 bool url_for_display, | 67 bool url_for_display) |
68 bool requires_authorization) | |
69 : state_(kStateIdle), | 68 : state_(kStateIdle), |
70 identifier_(identifier), | 69 identifier_(identifier), |
71 plugin_url_(plugin_url), | 70 plugin_url_(plugin_url), |
72 help_url_(help_url), | 71 help_url_(help_url), |
73 name_(name), | 72 name_(name), |
74 url_for_display_(url_for_display), | 73 url_for_display_(url_for_display) { |
75 requires_authorization_(requires_authorization) { | |
76 } | 74 } |
77 | 75 |
78 PluginInstaller::~PluginInstaller() { | 76 PluginInstaller::~PluginInstaller() { |
79 } | 77 } |
80 | 78 |
81 void PluginInstaller::OnDownloadUpdated(DownloadItem* download) { | 79 void PluginInstaller::OnDownloadUpdated(DownloadItem* download) { |
82 DownloadItem::DownloadState state = download->GetState(); | 80 DownloadItem::DownloadState state = download->GetState(); |
83 switch (state) { | 81 switch (state) { |
84 case DownloadItem::IN_PROGRESS: | 82 case DownloadItem::IN_PROGRESS: |
85 return; | 83 return; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 DCHECK(state_ == kStateDownloading); | 188 DCHECK(state_ == kStateDownloading); |
191 state_ = kStateIdle; | 189 state_ = kStateIdle; |
192 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); | 190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); |
193 } | 191 } |
194 | 192 |
195 void PluginInstaller::DownloadCancelled() { | 193 void PluginInstaller::DownloadCancelled() { |
196 DCHECK(state_ == kStateDownloading); | 194 DCHECK(state_ == kStateDownloading); |
197 state_ = kStateIdle; | 195 state_ = kStateIdle; |
198 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); | 196 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); |
199 } | 197 } |
OLD | NEW |