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

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

Issue 1417023007: Replace HostContentSettingsMap::AddExceptionForURL with SetNarrowestWebsiteSetting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/macros.h" 8 #include "base/macros.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 setting != CONTENT_SETTING_ASK); 407 setting != CONTENT_SETTING_ASK);
408 if (setting_source != SETTING_SOURCE_USER) { 408 if (setting_source != SETTING_SOURCE_USER) {
409 set_radio_group_enabled(false); 409 set_radio_group_enabled(false);
410 } else { 410 } else {
411 set_radio_group_enabled(true); 411 set_radio_group_enabled(true);
412 } 412 }
413 selected_item_ = radio_group.default_item; 413 selected_item_ = radio_group.default_item;
414 set_radio_group(radio_group); 414 set_radio_group(radio_group);
415 } 415 }
416 416
417 void ContentSettingSingleRadioGroup::AddException(ContentSetting setting) { 417 void ContentSettingSingleRadioGroup::AddException(ContentSetting setting) {
msw 2015/11/09 18:41:56 nit: rename AddException to match SetNarrowestCont
raymes 2015/11/09 23:29:02 Done.
418 if (profile()) { 418 if (profile()) {
419 HostContentSettingsMapFactory::GetForProfile(profile())->AddExceptionForURL( 419 HostContentSettingsMapFactory::GetForProfile(profile())
420 bubble_content().radio_group.url, 420 ->SetNarrowestContentSetting(bubble_content().radio_group.url,
421 bubble_content().radio_group.url, 421 bubble_content().radio_group.url,
422 content_type(), 422 content_type(), setting);
423 setting);
424 } 423 }
425 } 424 }
426 425
427 void ContentSettingSingleRadioGroup::OnRadioClicked(int radio_index) { 426 void ContentSettingSingleRadioGroup::OnRadioClicked(int radio_index) {
428 selected_item_ = radio_index; 427 selected_item_ = radio_index;
429 } 428 }
430 429
431 class ContentSettingCookiesBubbleModel : public ContentSettingSingleRadioGroup { 430 class ContentSettingCookiesBubbleModel : public ContentSettingSingleRadioGroup {
432 public: 431 public:
433 ContentSettingCookiesBubbleModel(Delegate* delegate, 432 ContentSettingCookiesBubbleModel(Delegate* delegate,
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { 1378 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
1380 DCHECK_EQ(web_contents_, 1379 DCHECK_EQ(web_contents_,
1381 content::Source<WebContents>(source).ptr()); 1380 content::Source<WebContents>(source).ptr());
1382 web_contents_ = NULL; 1381 web_contents_ = NULL;
1383 } else { 1382 } else {
1384 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 1383 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
1385 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 1384 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
1386 profile_ = NULL; 1385 profile_ = NULL;
1387 } 1386 }
1388 } 1387 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698