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

Side by Side Diff: chrome/browser/plugins/plugin_metadata.cc

Issue 23440066: Block NPAPI plugins by default Add Facebook video calling and Google Earth plugins to the tracked l… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: json version ++ Created 7 years, 2 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 | « no previous file | chrome/browser/plugins/plugin_metadata_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/plugins/plugin_metadata.h" 5 #include "chrome/browser/plugins/plugin_metadata.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 *status = SECURITY_STATUS_REQUIRES_AUTHORIZATION; 86 *status = SECURITY_STATUS_REQUIRES_AUTHORIZATION;
87 else 87 else
88 return false; 88 return false;
89 89
90 return true; 90 return true;
91 } 91 }
92 92
93 PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( 93 PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus(
94 const content::WebPluginInfo& plugin) const { 94 const content::WebPluginInfo& plugin) const {
95 if (versions_.empty()) { 95 if (versions_.empty()) {
96 #if defined(OS_LINUX) 96 // Unknown plugins require authorization.
97 // On Linux, unknown plugins require authorization.
98 return SECURITY_STATUS_REQUIRES_AUTHORIZATION; 97 return SECURITY_STATUS_REQUIRES_AUTHORIZATION;
99 #else
100 return SECURITY_STATUS_UP_TO_DATE;
101 #endif
102 } 98 }
103 99
104 Version version; 100 Version version;
105 content::WebPluginInfo::CreateVersionFromString(plugin.version, &version); 101 content::WebPluginInfo::CreateVersionFromString(plugin.version, &version);
106 if (!version.IsValid()) 102 if (!version.IsValid())
107 version = Version("0"); 103 version = Version("0");
108 104
109 // |lower_bound| returns the latest version that is not newer than |version|. 105 // |lower_bound| returns the latest version that is not newer than |version|.
110 std::map<Version, SecurityStatus, VersionComparator>::const_iterator it = 106 std::map<Version, SecurityStatus, VersionComparator>::const_iterator it =
111 versions_.lower_bound(version); 107 versions_.lower_bound(version);
(...skipping 15 matching lines...) Expand all
127 PluginMetadata* copy = new PluginMetadata(identifier_, 123 PluginMetadata* copy = new PluginMetadata(identifier_,
128 name_, 124 name_,
129 url_for_display_, 125 url_for_display_,
130 plugin_url_, 126 plugin_url_,
131 help_url_, 127 help_url_,
132 group_name_matcher_, 128 group_name_matcher_,
133 language_); 129 language_);
134 copy->versions_ = versions_; 130 copy->versions_ = versions_;
135 return make_scoped_ptr(copy); 131 return make_scoped_ptr(copy);
136 } 132 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugins/plugin_metadata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698