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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 542253003: Add a global on/off switch for content settings and expose a toggle on the Website Settings options… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@global-settings
Patch Set: Rebase. 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
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/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 bool setting_is_wildcard = false; 349 bool setting_is_wildcard = false;
350 350
351 if (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) { 351 if (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) {
352 CookieSettings* cookie_settings = 352 CookieSettings* cookie_settings =
353 CookieSettings::Factory::GetForProfile(profile()).get(); 353 CookieSettings::Factory::GetForProfile(profile()).get();
354 setting = cookie_settings->GetCookieSetting( 354 setting = cookie_settings->GetCookieSetting(
355 url, url, true, &setting_source); 355 url, url, true, &setting_source);
356 } else { 356 } else {
357 SettingInfo info; 357 SettingInfo info;
358 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); 358 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap();
359 scoped_ptr<base::Value> value(map->GetWebsiteSetting( 359 scoped_ptr<base::Value> value =
360 url, url, content_type(), std::string(), &info)); 360 map->GetWebsiteSetting(url, url, content_type(), std::string(), &info);
361 setting = content_settings::ValueToContentSetting(value.get()); 361 setting = content_settings::ValueToContentSetting(value.get());
362 setting_source = info.source; 362 setting_source = info.source;
363 setting_is_wildcard = 363 setting_is_wildcard =
364 info.primary_pattern == ContentSettingsPattern::Wildcard() && 364 info.primary_pattern == ContentSettingsPattern::Wildcard() &&
365 info.secondary_pattern == ContentSettingsPattern::Wildcard(); 365 info.secondary_pattern == ContentSettingsPattern::Wildcard();
366 } 366 }
367 367
368 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS && 368 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS &&
369 setting == CONTENT_SETTING_ALLOW && 369 setting == CONTENT_SETTING_ALLOW &&
370 setting_is_wildcard) { 370 setting_is_wildcard) {
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { 1322 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
1323 DCHECK_EQ(web_contents_, 1323 DCHECK_EQ(web_contents_,
1324 content::Source<WebContents>(source).ptr()); 1324 content::Source<WebContents>(source).ptr());
1325 web_contents_ = NULL; 1325 web_contents_ = NULL;
1326 } else { 1326 } else {
1327 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 1327 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
1328 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 1328 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
1329 profile_ = NULL; 1329 profile_ = NULL;
1330 } 1330 }
1331 } 1331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698