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

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

Issue 10881002: [2] Adding a method to PluginFinder to get a PluginInstaller by WebPluginInfo. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing Windows Compilation Error Created 8 years, 3 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
« no previous file with comments | « chrome/browser/plugin_installer.h ('k') | chrome/browser/plugin_installer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_installer.h ('k') | chrome/browser/plugin_installer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698