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/browsing_data/cookies_tree_model.cc

Issue 1694063002: Use GURLS instead of patterns in SetCookieSetting() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: fix bug in android Created 4 years, 9 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/browsing_data/cookies_tree_model.h" 5 #include "chrome/browser/browsing_data/cookies_tree_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 void CookieTreeHostNode::CreateContentException( 760 void CookieTreeHostNode::CreateContentException(
761 content_settings::CookieSettings* cookie_settings, 761 content_settings::CookieSettings* cookie_settings,
762 ContentSetting setting) const { 762 ContentSetting setting) const {
763 DCHECK(setting == CONTENT_SETTING_ALLOW || 763 DCHECK(setting == CONTENT_SETTING_ALLOW ||
764 setting == CONTENT_SETTING_BLOCK || 764 setting == CONTENT_SETTING_BLOCK ||
765 setting == CONTENT_SETTING_SESSION_ONLY); 765 setting == CONTENT_SETTING_SESSION_ONLY);
766 if (CanCreateContentException()) { 766 if (CanCreateContentException()) {
767 cookie_settings->ResetCookieSetting( 767 cookie_settings->ResetCookieSetting(
768 ContentSettingsPattern::FromURLNoWildcard(url_), 768 ContentSettingsPattern::FromURLNoWildcard(url_),
769 ContentSettingsPattern::Wildcard()); 769 ContentSettingsPattern::Wildcard());
770 cookie_settings->SetCookieSetting( 770 cookie_settings->SetCookieSetting(url_, setting);
771 ContentSettingsPattern::FromURL(url_),
772 ContentSettingsPattern::Wildcard(), setting);
773 } 771 }
774 } 772 }
775 773
776 bool CookieTreeHostNode::CanCreateContentException() const { 774 bool CookieTreeHostNode::CanCreateContentException() const {
777 return !url_.SchemeIsFile(); 775 return !url_.SchemeIsFile();
778 } 776 }
779 777
780 /////////////////////////////////////////////////////////////////////////////// 778 ///////////////////////////////////////////////////////////////////////////////
781 // CookieTreeCookiesNode, public: 779 // CookieTreeCookiesNode, public:
782 780
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 void CookiesTreeModel::MaybeNotifyBatchesEnded() { 1545 void CookiesTreeModel::MaybeNotifyBatchesEnded() {
1548 // Only notify the observers if this is the outermost call to EndBatch() if 1546 // Only notify the observers if this is the outermost call to EndBatch() if
1549 // called in a nested manner. 1547 // called in a nested manner.
1550 if (batches_ended_ == batches_started_ && 1548 if (batches_ended_ == batches_started_ &&
1551 batches_seen_ == batches_expected_) { 1549 batches_seen_ == batches_expected_) {
1552 FOR_EACH_OBSERVER(Observer, 1550 FOR_EACH_OBSERVER(Observer,
1553 cookies_observer_list_, 1551 cookies_observer_list_,
1554 TreeModelEndBatch(this)); 1552 TreeModelEndBatch(this));
1555 } 1553 }
1556 } 1554 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698