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

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

Issue 2278723003: Use StringPiece more in base::Value interfaces. (Closed)
Patch Set: Created 4 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
« base/values.h ('K') | « base/values.cc ('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 <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ->SetContentSettingCustomScope( 164 ->SetContentSettingCustomScope(
165 ContentSettingsPattern::Wildcard(), 165 ContentSettingsPattern::Wildcard(),
166 ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, 166 ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS,
167 plugin.get(), 167 plugin.get(),
168 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT); 168 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT);
169 169
170 // Keep track of the whitelist separately, so that we can distinguish plugins 170 // Keep track of the whitelist separately, so that we can distinguish plugins
171 // whitelisted by the user from automatically whitelisted ones. 171 // whitelisted by the user from automatically whitelisted ones.
172 DictionaryPrefUpdate update(profile->GetPrefs(), 172 DictionaryPrefUpdate update(profile->GetPrefs(),
173 prefs::kContentSettingsPluginWhitelist); 173 prefs::kContentSettingsPluginWhitelist);
174 update->SetBoolean(plugin, allowed); 174 update->SetBoolean(plugin.get(), allowed);
dcheng 2016/08/25 07:39:34 mojo::String will go away eventually, I guess.
175 } 175 }
176 176
177 void PluginsPageHandler::GetPluginsData( 177 void PluginsPageHandler::GetPluginsData(
178 const GetPluginsDataCallback& callback) { 178 const GetPluginsDataCallback& callback) {
179 if (weak_ptr_factory_.HasWeakPtrs()) 179 if (weak_ptr_factory_.HasWeakPtrs())
180 return; 180 return;
181 181
182 content::PluginService::GetInstance()->GetPlugins( 182 content::PluginService::GetInstance()->GetPlugins(
183 base::Bind(&PluginsPageHandler::RespondWithPluginsData, 183 base::Bind(&PluginsPageHandler::RespondWithPluginsData,
184 weak_ptr_factory_.GetWeakPtr(), callback)); 184 weak_ptr_factory_.GetWeakPtr(), callback));
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 364 }
365 365
366 if (plugins_enabled_by_policy) 366 if (plugins_enabled_by_policy)
367 return "enabledByPolicy"; 367 return "enabledByPolicy";
368 if (plugins_disabled_by_policy) 368 if (plugins_disabled_by_policy)
369 return "disabledByPolicy"; 369 return "disabledByPolicy";
370 if (plugins_managed_by_policy) 370 if (plugins_managed_by_policy)
371 return "managedByPolicy"; 371 return "managedByPolicy";
372 return group_enabled ? "enabledByUser" : "disabledByUser"; 372 return group_enabled ? "enabledByUser" : "disabledByUser";
373 } 373 }
OLDNEW
« base/values.h ('K') | « base/values.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698