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

Side by Side Diff: chrome/browser/cookies_tree_model.cc

Issue 2878075: Introduce a resource identifier for content settings. (Closed)
Patch Set: updates Created 10 years, 4 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/cookie_modal_dialog.cc ('k') | chrome/browser/cookies_tree_model_unittest.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cookies_tree_model.h" 5 #include "chrome/browser/cookies_tree_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 appcaches_child_ = new CookieTreeAppCachesNode; 245 appcaches_child_ = new CookieTreeAppCachesNode;
246 AddChildSortedByTitle(appcaches_child_); 246 AddChildSortedByTitle(appcaches_child_);
247 return appcaches_child_; 247 return appcaches_child_;
248 } 248 }
249 249
250 void CookieTreeOriginNode::CreateContentException( 250 void CookieTreeOriginNode::CreateContentException(
251 HostContentSettingsMap* content_settings, ContentSetting setting) const { 251 HostContentSettingsMap* content_settings, ContentSetting setting) const {
252 if (CanCreateContentException()) { 252 if (CanCreateContentException()) {
253 content_settings->AddExceptionForURL(url_, 253 content_settings->AddExceptionForURL(url_,
254 CONTENT_SETTINGS_TYPE_COOKIES, 254 CONTENT_SETTINGS_TYPE_COOKIES,
255 "",
255 setting); 256 setting);
256 } 257 }
257 } 258 }
258 259
259 bool CookieTreeOriginNode::CanCreateContentException() const { 260 bool CookieTreeOriginNode::CanCreateContentException() const {
260 return !url_.SchemeIsFile(); 261 return !url_.SchemeIsFile();
261 } 262 }
262 263
263 /////////////////////////////////////////////////////////////////////////////// 264 ///////////////////////////////////////////////////////////////////////////////
264 // CookieTreeCookiesNode, public: 265 // CookieTreeCookiesNode, public:
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 582
582 void CookiesTreeModel::NotifyObserverEndBatch() { 583 void CookiesTreeModel::NotifyObserverEndBatch() {
583 // Only notify the observers if this is the outermost call to EndBatch() if 584 // Only notify the observers if this is the outermost call to EndBatch() if
584 // called in a nested manner. 585 // called in a nested manner.
585 if (--batch_update_ == 0) { 586 if (--batch_update_ == 0) {
586 FOR_EACH_OBSERVER(Observer, 587 FOR_EACH_OBSERVER(Observer,
587 cookies_observer_list_, 588 cookies_observer_list_,
588 TreeModelEndBatch(this)); 589 TreeModelEndBatch(this));
589 } 590 }
590 } 591 }
OLDNEW
« no previous file with comments | « chrome/browser/cookie_modal_dialog.cc ('k') | chrome/browser/cookies_tree_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698