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

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

Issue 10263022: Move version metadata from PluginGroup into PluginInstaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 7 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 | Annotate | Revision Log
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_finder.h" 5 #include "chrome/browser/plugin_finder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 std::string url; 123 std::string url;
124 bool success = plugin_dict->GetString("url", &url); 124 bool success = plugin_dict->GetString("url", &url);
125 DCHECK(success); 125 DCHECK(success);
126 std::string help_url; 126 std::string help_url;
127 plugin_dict->GetString("help_url", &help_url); 127 plugin_dict->GetString("help_url", &help_url);
128 string16 name; 128 string16 name;
129 success = plugin_dict->GetString("name", &name); 129 success = plugin_dict->GetString("name", &name);
130 DCHECK(success); 130 DCHECK(success);
131 bool display_url = false; 131 bool display_url = false;
132 plugin_dict->GetBoolean("displayurl", &display_url); 132 plugin_dict->GetBoolean("displayurl", &display_url);
133 bool requires_authorization = true; 133
134 plugin_dict->GetBoolean("requires_authorization", &requires_authorization);
135 PluginInstaller* installer = new PluginInstaller(identifier, 134 PluginInstaller* installer = new PluginInstaller(identifier,
136 GURL(url),
137 GURL(help_url),
138 name, 135 name,
139 display_url, 136 display_url,
140 requires_authorization); 137 GURL(url),
138 GURL(help_url));
139 ListValue* versions = NULL;
140 if (plugin_dict->GetList("versions", &versions)) {
141 for (ListValue::const_iterator it = versions->begin();
142 it != versions->end(); ++it) {
143 DictionaryValue* version_dict = NULL;
144 if (!(*it)->GetAsDictionary(&version_dict)) {
145 NOTREACHED();
146 continue;
147 }
148 std::string version;
149 success = version_dict->GetString("version", &version);
150 DCHECK(success);
151 std::string status_str;
152 success = version_dict->GetString("status", &status_str);
153 DCHECK(success);
154 PluginInstaller::SecurityStatus status =
155 PluginInstaller::SECURITY_STATUS_UP_TO_DATE;
156 success = PluginInstaller::ParseSecurityStatus(status_str, &status);
157 DCHECK(success);
158 installer->AddVersion(Version(version), status);
159 }
160 }
161
141 installers_[identifier] = installer; 162 installers_[identifier] = installer;
142 return installer; 163 return installer;
143 } 164 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/content_settings/content_settings_apitest.cc ('k') | chrome/browser/plugin_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698