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

Side by Side Diff: chrome/browser/ui/pdf/adobe_reader_info_win.cc

Issue 549313003: Windows: Fix the plugin metadata check to determine if Adobe Reader is secure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/pdf/adobe_reader_info_win.h" 5 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 reader_info.is_installed = true; 88 reader_info.is_installed = true;
89 89
90 if (profile) { 90 if (profile) {
91 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); 91 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile);
92 PluginPrefs::PolicyStatus plugin_status = 92 PluginPrefs::PolicyStatus plugin_status =
93 plugin_prefs->PolicyStatusForPlugin(plugin_metadata->name()); 93 plugin_prefs->PolicyStatusForPlugin(plugin_metadata->name());
94 reader_info.is_enabled = plugin_status != PluginPrefs::POLICY_DISABLED; 94 reader_info.is_enabled = plugin_status != PluginPrefs::POLICY_DISABLED;
95 } 95 }
96 96
97 PluginMetadata::SecurityStatus security_status = 97 // Adobe Reader will likely always come up as "requires_authorization".
98 // See http://crbug.com/311655.
99 PluginMetadata::SecurityStatus security_stat =
98 plugin_metadata->GetSecurityStatus(plugins[i]); 100 plugin_metadata->GetSecurityStatus(plugins[i]);
99 reader_info.is_secure = 101 reader_info.is_secure =
100 security_status == PluginMetadata::SECURITY_STATUS_UP_TO_DATE; 102 security_stat == PluginMetadata::SECURITY_STATUS_UP_TO_DATE ||
Bernhard Bauer 2014/09/09 08:22:37 Change this directly to != SECURITY_STATUS_OUT_OF_
Lei Zhang 2014/09/09 18:26:35 I want to be explicitly about it. In case someone
103 security_stat == PluginMetadata::SECURITY_STATUS_REQUIRES_AUTHORIZATION;
101 104
102 reader_info.plugin_info = plugins[i]; 105 reader_info.plugin_info = plugins[i];
103 break; 106 break;
104 } 107 }
105 return reader_info; 108 return reader_info;
106 } 109 }
107 110
108 void OnGotPluginInfo(Profile* profile, 111 void OnGotPluginInfo(Profile* profile,
109 const GetAdobeReaderPluginInfoCallback& callback, 112 const GetAdobeReaderPluginInfoCallback& callback,
110 const std::vector<content::WebPluginInfo>& plugins) { 113 const std::vector<content::WebPluginInfo>& plugins) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 base::UTF16ToUTF8(file_version_info->product_version()); 177 base::UTF16ToUTF8(file_version_info->product_version());
175 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid. 178 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid.
176 for (int i = 1; i <= 9; ++i) { 179 for (int i = 1; i <= 9; ++i) {
177 std::string from = base::StringPrintf(".0%d", i); 180 std::string from = base::StringPrintf(".0%d", i);
178 std::string to = base::StringPrintf(".%d", i); 181 std::string to = base::StringPrintf(".%d", i);
179 ReplaceSubstringsAfterOffset(&reader_version, 0, from, to); 182 ReplaceSubstringsAfterOffset(&reader_version, 0, from, to);
180 } 183 }
181 base::Version file_version(reader_version); 184 base::Version file_version(reader_version);
182 return file_version.IsValid() && !file_version.IsOlderThan(kSecureVersion); 185 return file_version.IsValid() && !file_version.IsOlderThan(kSecureVersion);
183 } 186 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698