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/tab_contents/tab_specific_content_settings.h" | 5 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browsing_data_appcache_helper.h" | 8 #include "chrome/browser/browsing_data_appcache_helper.h" |
9 #include "chrome/browser/browsing_data_database_helper.h" | 9 #include "chrome/browser/browsing_data_database_helper.h" |
10 #include "chrome/browser/browsing_data_indexed_db_helper.h" | 10 #include "chrome/browser/browsing_data_indexed_db_helper.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 content_accessed_[type] = true; | 100 content_accessed_[type] = true; |
101 if (delegate_) | 101 if (delegate_) |
102 delegate_->OnContentSettingsAccessed(false); | 102 delegate_->OnContentSettingsAccessed(false); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 void TabSpecificContentSettings::OnCookiesRead( | 106 void TabSpecificContentSettings::OnCookiesRead( |
107 const GURL& url, | 107 const GURL& url, |
108 const net::CookieList& cookie_list, | 108 const net::CookieList& cookie_list, |
109 bool blocked_by_policy) { | 109 bool blocked_by_policy) { |
| 110 if (cookie_list.empty()) |
| 111 return; |
110 LocalSharedObjectsContainer& container = blocked_by_policy ? | 112 LocalSharedObjectsContainer& container = blocked_by_policy ? |
111 blocked_local_shared_objects_ : allowed_local_shared_objects_; | 113 blocked_local_shared_objects_ : allowed_local_shared_objects_; |
112 typedef net::CookieList::const_iterator cookie_iterator; | 114 typedef net::CookieList::const_iterator cookie_iterator; |
113 for (cookie_iterator cookie = cookie_list.begin(); | 115 for (cookie_iterator cookie = cookie_list.begin(); |
114 cookie != cookie_list.end(); ++cookie) { | 116 cookie != cookie_list.end(); ++cookie) { |
115 container.cookies()->SetCookieWithDetails(url, | 117 container.cookies()->SetCookieWithDetails(url, |
116 cookie->Name(), | 118 cookie->Name(), |
117 cookie->Value(), | 119 cookie->Value(), |
118 cookie->Domain(), | 120 cookie->Domain(), |
119 cookie->Path(), | 121 cookie->Path(), |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 299 |
298 CookiesTreeModel* | 300 CookiesTreeModel* |
299 TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() { | 301 TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() { |
300 return new CookiesTreeModel(cookies_, | 302 return new CookiesTreeModel(cookies_, |
301 databases_, | 303 databases_, |
302 local_storages_, | 304 local_storages_, |
303 session_storages_, | 305 session_storages_, |
304 appcaches_, | 306 appcaches_, |
305 indexed_dbs_); | 307 indexed_dbs_); |
306 } | 308 } |
OLD | NEW |