| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |