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

Side by Side Diff: chrome/browser/ui/webui/plugins/plugins_handler.cc

Issue 1857263004: Always trust internal PDF viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase rebase Created 4 years, 8 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/ui/webui/plugins/plugins.mojom ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/webui/plugins/plugins_handler.h" 5 #include "chrome/browser/ui/webui/plugins/plugins_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Update |active_plugin| and |group_enabled|. 251 // Update |active_plugin| and |group_enabled|.
252 if (!active_plugin || (plugin_enabled && !group_enabled)) 252 if (!active_plugin || (plugin_enabled && !group_enabled))
253 active_plugin = group_plugin; 253 active_plugin = group_plugin;
254 group_enabled = plugin_enabled || group_enabled; 254 group_enabled = plugin_enabled || group_enabled;
255 } 255 }
256 256
257 plugin_data->enabled_mode = mojo::String::From( 257 plugin_data->enabled_mode = mojo::String::From(
258 GetPluginGroupEnabledMode(plugin_files, group_enabled)); 258 GetPluginGroupEnabledMode(plugin_files, group_enabled));
259 259
260 plugin_data->always_allowed = false; 260 plugin_data->always_allowed = false;
261 plugin_data->trusted = false;
262
261 if (group_enabled) { 263 if (group_enabled) {
262 const base::DictionaryValue* whitelist = 264 if (plugin_metadata->GetSecurityStatus(*active_plugin) ==
263 profile->GetPrefs()->GetDictionary( 265 PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
264 prefs::kContentSettingsPluginWhitelist); 266 plugin_data->trusted = true;
265 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed); 267 plugin_data->always_allowed = true;
268 } else {
269 const base::DictionaryValue* whitelist =
270 profile->GetPrefs()->GetDictionary(
271 prefs::kContentSettingsPluginWhitelist);
272 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed);
273 }
266 } 274 }
267 275
268 plugin_data->critical = false; 276 plugin_data->critical = false;
269 plugin_data->update_url = ""; 277 plugin_data->update_url = "";
270 #if defined(ENABLE_PLUGIN_INSTALLATION) 278 #if defined(ENABLE_PLUGIN_INSTALLATION)
271 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) == 279 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) ==
272 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE; 280 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE;
273 plugin_data->critical = out_of_date; 281 plugin_data->critical = out_of_date;
274 plugin_data->update_url = plugin_metadata->plugin_url().spec(); 282 plugin_data->update_url = plugin_metadata->plugin_url().spec();
275 #endif 283 #endif
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 351 }
344 352
345 if (plugins_enabled_by_policy) 353 if (plugins_enabled_by_policy)
346 return "enabledByPolicy"; 354 return "enabledByPolicy";
347 if (plugins_disabled_by_policy) 355 if (plugins_disabled_by_policy)
348 return "disabledByPolicy"; 356 return "disabledByPolicy";
349 if (plugins_managed_by_policy) 357 if (plugins_managed_by_policy)
350 return "managedByPolicy"; 358 return "managedByPolicy";
351 return group_enabled ? "enabledByUser" : "disabledByUser"; 359 return group_enabled ? "enabledByUser" : "disabledByUser";
352 } 360 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/plugins/plugins.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698