| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::Bind(callback, content::DownloadId::Invalid(), error)); | 65 base::Bind(callback, content::DownloadId::Invalid(), error)); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 PluginInstaller::PluginInstaller(const std::string& identifier, | 71 PluginInstaller::PluginInstaller(const std::string& identifier, |
| 72 const string16& name, | 72 const string16& name, |
| 73 bool url_for_display, | 73 bool url_for_display, |
| 74 const GURL& plugin_url, | 74 const GURL& plugin_url, |
| 75 const GURL& help_url) | 75 const GURL& help_url, |
| 76 const string16& group_name_matcher) |
| 76 : identifier_(identifier), | 77 : identifier_(identifier), |
| 77 name_(name), | 78 name_(name), |
| 79 group_name_matcher_(group_name_matcher), |
| 78 url_for_display_(url_for_display), | 80 url_for_display_(url_for_display), |
| 79 plugin_url_(plugin_url), | 81 plugin_url_(plugin_url), |
| 80 help_url_(help_url), | 82 help_url_(help_url), |
| 81 state_(INSTALLER_STATE_IDLE) { | 83 state_(INSTALLER_STATE_IDLE) { |
| 82 } | 84 } |
| 83 | 85 |
| 84 PluginInstaller::~PluginInstaller() { | 86 PluginInstaller::~PluginInstaller() { |
| 85 } | 87 } |
| 86 | 88 |
| 87 void PluginInstaller::AddVersion(const Version& version, | 89 void PluginInstaller::AddVersion(const Version& version, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 245 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
| 244 state_ = INSTALLER_STATE_IDLE; | 246 state_ = INSTALLER_STATE_IDLE; |
| 245 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); | 247 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); |
| 246 } | 248 } |
| 247 | 249 |
| 248 void PluginInstaller::DownloadCancelled() { | 250 void PluginInstaller::DownloadCancelled() { |
| 249 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 251 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
| 250 state_ = INSTALLER_STATE_IDLE; | 252 state_ = INSTALLER_STATE_IDLE; |
| 251 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); | 253 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); |
| 252 } | 254 } |
| 255 |
| 256 bool PluginInstaller::MatchesPlugin(const webkit::WebPluginInfo& plugin) { |
| 257 return plugin.name.find(group_name_matcher_) != string16::npos; |
| 258 } |
| OLD | NEW |