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

Side by Side Diff: chrome/browser/ui/webui/plugins_ui.cc

Issue 1312453005: Removed Profile::GetHostContentSettingsMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed patch conflict Created 5 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 | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | chrome/chrome_browser.gypi » ('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/ui/webui/plugins_ui.h" 5 #include "chrome/browser/ui/webui/plugins_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/ref_counted_memory.h" 14 #include "base/memory/ref_counted_memory.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/path_service.h" 19 #include "base/path_service.h"
20 #include "base/prefs/pref_member.h" 20 #include "base/prefs/pref_member.h"
21 #include "base/prefs/pref_service.h" 21 #include "base/prefs/pref_service.h"
22 #include "base/prefs/scoped_user_pref_update.h" 22 #include "base/prefs/scoped_user_pref_update.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "base/values.h" 24 #include "base/values.h"
25 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
26 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
26 #include "chrome/browser/plugins/plugin_finder.h" 27 #include "chrome/browser/plugins/plugin_finder.h"
27 #include "chrome/browser/plugins/plugin_metadata.h" 28 #include "chrome/browser/plugins/plugin_metadata.h"
28 #include "chrome/browser/plugins/plugin_prefs.h" 29 #include "chrome/browser/plugins/plugin_prefs.h"
29 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/browser/ui/browser.h" 31 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
32 #include "chrome/common/chrome_content_client.h" 33 #include "chrome/common/chrome_content_client.h"
33 #include "chrome/common/chrome_paths.h" 34 #include "chrome/common/chrome_paths.h"
34 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
35 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return; 295 return;
295 } 296 }
296 297
297 std::string plugin; 298 std::string plugin;
298 bool allowed = false; 299 bool allowed = false;
299 if (!args->GetString(0, &plugin) || !args->GetBoolean(1, &allowed)) { 300 if (!args->GetString(0, &plugin) || !args->GetBoolean(1, &allowed)) {
300 NOTREACHED(); 301 NOTREACHED();
301 return; 302 return;
302 } 303 }
303 Profile* profile = Profile::FromWebUI(web_ui()); 304 Profile* profile = Profile::FromWebUI(web_ui());
304 profile->GetHostContentSettingsMap()->SetContentSetting( 305 HostContentSettingsMapFactory::GetForProfile(profile)->SetContentSetting(
305 ContentSettingsPattern::Wildcard(), 306 ContentSettingsPattern::Wildcard(),
306 ContentSettingsPattern::Wildcard(), 307 ContentSettingsPattern::Wildcard(),
307 CONTENT_SETTINGS_TYPE_PLUGINS, 308 CONTENT_SETTINGS_TYPE_PLUGINS,
308 plugin, 309 plugin,
309 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT); 310 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_DEFAULT);
310 311
311 // Keep track of the whitelist separately, so that we can distinguish plugins 312 // Keep track of the whitelist separately, so that we can distinguish plugins
312 // whitelisted by the user from automatically whitelisted ones. 313 // whitelisted by the user from automatically whitelisted ones.
313 DictionaryPrefUpdate update(profile->GetPrefs(), 314 DictionaryPrefUpdate update(profile->GetPrefs(),
314 prefs::kContentSettingsPluginWhitelist); 315 prefs::kContentSettingsPluginWhitelist);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 522 }
522 523
523 // static 524 // static
524 void PluginsUI::RegisterProfilePrefs( 525 void PluginsUI::RegisterProfilePrefs(
525 user_prefs::PrefRegistrySyncable* registry) { 526 user_prefs::PrefRegistrySyncable* registry) {
526 registry->RegisterBooleanPref(prefs::kPluginsShowDetails, false); 527 registry->RegisterBooleanPref(prefs::kPluginsShowDetails, false);
527 registry->RegisterDictionaryPref( 528 registry->RegisterDictionaryPref(
528 prefs::kContentSettingsPluginWhitelist, 529 prefs::kContentSettingsPluginWhitelist,
529 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 530 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
530 } 531 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698