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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 /////////////////////////////////////////////////////////////////////////////// | 45 /////////////////////////////////////////////////////////////////////////////// |
46 // CookieTreeCookieNode, public: | 46 // CookieTreeCookieNode, public: |
47 | 47 |
48 CookieTreeCookieNode::CookieTreeCookieNode( | 48 CookieTreeCookieNode::CookieTreeCookieNode( |
49 net::CookieMonster::CanonicalCookie* cookie) | 49 net::CookieMonster::CanonicalCookie* cookie) |
50 : CookieTreeNode(UTF8ToUTF16(cookie->Name())), | 50 : CookieTreeNode(UTF8ToUTF16(cookie->Name())), |
51 cookie_(cookie) { | 51 cookie_(cookie) { |
52 } | 52 } |
53 | 53 |
| 54 CookieTreeCookieNode::~CookieTreeCookieNode() {} |
| 55 |
54 void CookieTreeCookieNode::DeleteStoredObjects() { | 56 void CookieTreeCookieNode::DeleteStoredObjects() { |
55 // notify CookieMonster that we should delete this cookie | 57 // notify CookieMonster that we should delete this cookie |
56 // We have stored a copy of all the cookies in the model, and our model is | 58 // We have stored a copy of all the cookies in the model, and our model is |
57 // never re-calculated. Thus, we just need to delete the nodes from our | 59 // never re-calculated. Thus, we just need to delete the nodes from our |
58 // model, and tell CookieMonster to delete the cookies. We can keep the | 60 // model, and tell CookieMonster to delete the cookies. We can keep the |
59 // vector storing the cookies in-tact and not delete from there (that would | 61 // vector storing the cookies in-tact and not delete from there (that would |
60 // invalidate our pointers), and the fact that it contains semi out-of-date | 62 // invalidate our pointers), and the fact that it contains semi out-of-date |
61 // data is not problematic as we don't re-build the model based on that. | 63 // data is not problematic as we don't re-build the model based on that. |
62 GetModel()->cookie_monster_->DeleteCanonicalCookie(*cookie_); | 64 GetModel()->cookie_monster_->DeleteCanonicalCookie(*cookie_); |
63 } | 65 } |
64 | 66 |
| 67 CookieTreeNode::DetailedInfo CookieTreeCookieNode::GetDetailedInfo() const { |
| 68 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 69 DetailedInfo::TYPE_COOKIE, |
| 70 cookie_, NULL, NULL, NULL, NULL, NULL); |
| 71 } |
| 72 |
65 namespace { | 73 namespace { |
66 // comparison functor, for use in CookieTreeRootNode | 74 // comparison functor, for use in CookieTreeRootNode |
67 class OriginNodeComparator { | 75 class OriginNodeComparator { |
68 public: | 76 public: |
69 bool operator() (const CookieTreeNode* lhs, | 77 bool operator() (const CookieTreeNode* lhs, |
70 const CookieTreeNode* rhs) { | 78 const CookieTreeNode* rhs) { |
71 // We want to order by registry controlled domain, so we would get | 79 // We want to order by registry controlled domain, so we would get |
72 // google.com, ad.google.com, www.google.com, | 80 // google.com, ad.google.com, www.google.com, |
73 // microsoft.com, ad.microsoft.com. CanonicalizeHost transforms the origins | 81 // microsoft.com, ad.microsoft.com. CanonicalizeHost transforms the origins |
74 // into a form like google.com.www so that string comparisons work. | 82 // into a form like google.com.www so that string comparisons work. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 : CookieTreeNode(UTF8ToUTF16(appcache_info->manifest_url.spec())), | 137 : CookieTreeNode(UTF8ToUTF16(appcache_info->manifest_url.spec())), |
130 appcache_info_(appcache_info) { | 138 appcache_info_(appcache_info) { |
131 } | 139 } |
132 | 140 |
133 void CookieTreeAppCacheNode::DeleteStoredObjects() { | 141 void CookieTreeAppCacheNode::DeleteStoredObjects() { |
134 DCHECK(GetModel()->appcache_helper_); | 142 DCHECK(GetModel()->appcache_helper_); |
135 GetModel()->appcache_helper_->DeleteAppCacheGroup( | 143 GetModel()->appcache_helper_->DeleteAppCacheGroup( |
136 appcache_info_->manifest_url); | 144 appcache_info_->manifest_url); |
137 } | 145 } |
138 | 146 |
| 147 CookieTreeNode::DetailedInfo CookieTreeAppCacheNode::GetDetailedInfo() const { |
| 148 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 149 DetailedInfo::TYPE_APPCACHE, |
| 150 NULL, NULL, NULL, NULL, appcache_info_, NULL); |
| 151 } |
| 152 |
139 /////////////////////////////////////////////////////////////////////////////// | 153 /////////////////////////////////////////////////////////////////////////////// |
140 // CookieTreeDatabaseNode, public: | 154 // CookieTreeDatabaseNode, public: |
141 | 155 |
142 CookieTreeDatabaseNode::CookieTreeDatabaseNode( | 156 CookieTreeDatabaseNode::CookieTreeDatabaseNode( |
143 BrowsingDataDatabaseHelper::DatabaseInfo* database_info) | 157 BrowsingDataDatabaseHelper::DatabaseInfo* database_info) |
144 : CookieTreeNode(database_info->database_name.empty() ? | 158 : CookieTreeNode(database_info->database_name.empty() ? |
145 l10n_util::GetStringUTF16(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME) : | 159 l10n_util::GetStringUTF16(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME) : |
146 UTF8ToUTF16(database_info->database_name)), | 160 UTF8ToUTF16(database_info->database_name)), |
147 database_info_(database_info) { | 161 database_info_(database_info) { |
148 } | 162 } |
149 | 163 |
| 164 CookieTreeDatabaseNode::~CookieTreeDatabaseNode() {} |
| 165 |
150 void CookieTreeDatabaseNode::DeleteStoredObjects() { | 166 void CookieTreeDatabaseNode::DeleteStoredObjects() { |
151 GetModel()->database_helper_->DeleteDatabase( | 167 GetModel()->database_helper_->DeleteDatabase( |
152 database_info_->origin_identifier, database_info_->database_name); | 168 database_info_->origin_identifier, database_info_->database_name); |
153 } | 169 } |
154 | 170 |
| 171 CookieTreeNode::DetailedInfo CookieTreeDatabaseNode::GetDetailedInfo() const { |
| 172 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 173 DetailedInfo::TYPE_DATABASE, |
| 174 NULL, database_info_, NULL, NULL, NULL, NULL); |
| 175 } |
| 176 |
155 /////////////////////////////////////////////////////////////////////////////// | 177 /////////////////////////////////////////////////////////////////////////////// |
156 // CookieTreeLocalStorageNode, public: | 178 // CookieTreeLocalStorageNode, public: |
157 | 179 |
158 CookieTreeLocalStorageNode::CookieTreeLocalStorageNode( | 180 CookieTreeLocalStorageNode::CookieTreeLocalStorageNode( |
159 BrowsingDataLocalStorageHelper::LocalStorageInfo* local_storage_info) | 181 BrowsingDataLocalStorageHelper::LocalStorageInfo* local_storage_info) |
160 : CookieTreeNode(UTF8ToUTF16( | 182 : CookieTreeNode(UTF8ToUTF16( |
161 local_storage_info->origin.empty() ? | 183 local_storage_info->origin.empty() ? |
162 local_storage_info->database_identifier : | 184 local_storage_info->database_identifier : |
163 local_storage_info->origin)), | 185 local_storage_info->origin)), |
164 local_storage_info_(local_storage_info) { | 186 local_storage_info_(local_storage_info) { |
165 } | 187 } |
166 | 188 |
| 189 CookieTreeLocalStorageNode::~CookieTreeLocalStorageNode() {} |
| 190 |
167 void CookieTreeLocalStorageNode::DeleteStoredObjects() { | 191 void CookieTreeLocalStorageNode::DeleteStoredObjects() { |
168 GetModel()->local_storage_helper_->DeleteLocalStorageFile( | 192 GetModel()->local_storage_helper_->DeleteLocalStorageFile( |
169 local_storage_info_->file_path); | 193 local_storage_info_->file_path); |
170 } | 194 } |
171 | 195 |
| 196 CookieTreeNode::DetailedInfo |
| 197 CookieTreeLocalStorageNode::GetDetailedInfo() const { |
| 198 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 199 DetailedInfo::TYPE_LOCAL_STORAGE, |
| 200 NULL, NULL, local_storage_info_, NULL, NULL, NULL); |
| 201 } |
| 202 |
172 /////////////////////////////////////////////////////////////////////////////// | 203 /////////////////////////////////////////////////////////////////////////////// |
173 // CookieTreeSessionStorageNode, public: | 204 // CookieTreeSessionStorageNode, public: |
174 | 205 |
175 CookieTreeSessionStorageNode::CookieTreeSessionStorageNode( | 206 CookieTreeSessionStorageNode::CookieTreeSessionStorageNode( |
176 BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info) | 207 BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info) |
177 : CookieTreeNode(UTF8ToUTF16( | 208 : CookieTreeNode(UTF8ToUTF16( |
178 session_storage_info->origin.empty() ? | 209 session_storage_info->origin.empty() ? |
179 session_storage_info->database_identifier : | 210 session_storage_info->database_identifier : |
180 session_storage_info->origin)), | 211 session_storage_info->origin)), |
181 session_storage_info_(session_storage_info) { | 212 session_storage_info_(session_storage_info) { |
182 } | 213 } |
183 | 214 |
| 215 CookieTreeSessionStorageNode::~CookieTreeSessionStorageNode() {} |
| 216 |
| 217 CookieTreeNode::DetailedInfo |
| 218 CookieTreeSessionStorageNode::GetDetailedInfo() const { |
| 219 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 220 DetailedInfo::TYPE_SESSION_STORAGE, |
| 221 NULL, NULL, NULL, session_storage_info_, NULL, NULL); |
| 222 } |
| 223 |
184 /////////////////////////////////////////////////////////////////////////////// | 224 /////////////////////////////////////////////////////////////////////////////// |
185 // CookieTreeIndexedDBNode, public: | 225 // CookieTreeIndexedDBNode, public: |
186 | 226 |
187 CookieTreeIndexedDBNode::CookieTreeIndexedDBNode( | 227 CookieTreeIndexedDBNode::CookieTreeIndexedDBNode( |
188 BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info) | 228 BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info) |
189 : CookieTreeNode(UTF8ToUTF16( | 229 : CookieTreeNode(UTF8ToUTF16( |
190 indexed_db_info->origin.empty() ? | 230 indexed_db_info->origin.empty() ? |
191 indexed_db_info->database_identifier : | 231 indexed_db_info->database_identifier : |
192 indexed_db_info->origin)), | 232 indexed_db_info->origin)), |
193 indexed_db_info_(indexed_db_info) { | 233 indexed_db_info_(indexed_db_info) { |
194 } | 234 } |
195 | 235 |
| 236 CookieTreeIndexedDBNode::~CookieTreeIndexedDBNode() {} |
| 237 |
196 void CookieTreeIndexedDBNode::DeleteStoredObjects() { | 238 void CookieTreeIndexedDBNode::DeleteStoredObjects() { |
197 GetModel()->indexed_db_helper_->DeleteIndexedDBFile( | 239 GetModel()->indexed_db_helper_->DeleteIndexedDBFile( |
198 indexed_db_info_->file_path); | 240 indexed_db_info_->file_path); |
199 } | 241 } |
200 | 242 |
| 243 CookieTreeNode::DetailedInfo CookieTreeIndexedDBNode::GetDetailedInfo() const { |
| 244 return DetailedInfo(GetParent()->GetParent()->GetTitle(), |
| 245 DetailedInfo::TYPE_INDEXED_DB, |
| 246 NULL, NULL, NULL, NULL, NULL, indexed_db_info_); |
| 247 } |
| 248 |
201 /////////////////////////////////////////////////////////////////////////////// | 249 /////////////////////////////////////////////////////////////////////////////// |
202 // CookieTreeRootNode, public: | 250 // CookieTreeRootNode, public: |
203 | 251 |
| 252 CookieTreeRootNode::CookieTreeRootNode(CookiesTreeModel* model) |
| 253 : model_(model) { |
| 254 } |
| 255 |
| 256 CookieTreeRootNode::~CookieTreeRootNode() {} |
| 257 |
204 CookieTreeOriginNode* CookieTreeRootNode::GetOrCreateOriginNode( | 258 CookieTreeOriginNode* CookieTreeRootNode::GetOrCreateOriginNode( |
205 const GURL& url) { | 259 const GURL& url) { |
206 CookieTreeOriginNode origin_node(url); | 260 CookieTreeOriginNode origin_node(url); |
207 | 261 |
208 // First see if there is an existing match. | 262 // First see if there is an existing match. |
209 std::vector<CookieTreeNode*>::iterator origin_node_iterator = | 263 std::vector<CookieTreeNode*>::iterator origin_node_iterator = |
210 lower_bound(children().begin(), | 264 lower_bound(children().begin(), |
211 children().end(), | 265 children().end(), |
212 &origin_node, | 266 &origin_node, |
213 OriginNodeComparator()); | 267 OriginNodeComparator()); |
214 | 268 |
215 if (origin_node_iterator != children().end() && | 269 if (origin_node_iterator != children().end() && |
216 WideToUTF16Hack(CookieTreeOriginNode::TitleForUrl(url)) == | 270 WideToUTF16Hack(CookieTreeOriginNode::TitleForUrl(url)) == |
217 (*origin_node_iterator)->GetTitle()) | 271 (*origin_node_iterator)->GetTitle()) |
218 return static_cast<CookieTreeOriginNode*>(*origin_node_iterator); | 272 return static_cast<CookieTreeOriginNode*>(*origin_node_iterator); |
219 // Node doesn't exist, create a new one and insert it into the (ordered) | 273 // Node doesn't exist, create a new one and insert it into the (ordered) |
220 // children. | 274 // children. |
221 CookieTreeOriginNode* retval = new CookieTreeOriginNode(url); | 275 CookieTreeOriginNode* retval = new CookieTreeOriginNode(url); |
222 DCHECK(model_); | 276 DCHECK(model_); |
223 model_->Add(this, (origin_node_iterator - children().begin()), retval); | 277 model_->Add(this, (origin_node_iterator - children().begin()), retval); |
224 return retval; | 278 return retval; |
225 } | 279 } |
226 | 280 |
| 281 CookiesTreeModel* CookieTreeRootNode::GetModel() const { |
| 282 return model_; |
| 283 } |
| 284 |
| 285 CookieTreeNode::DetailedInfo CookieTreeRootNode::GetDetailedInfo() const { |
| 286 return DetailedInfo(string16(), |
| 287 DetailedInfo::TYPE_ROOT, |
| 288 NULL, NULL, NULL, NULL, NULL, NULL); |
| 289 } |
| 290 |
227 /////////////////////////////////////////////////////////////////////////////// | 291 /////////////////////////////////////////////////////////////////////////////// |
228 // CookieTreeOriginNode, public: | 292 // CookieTreeOriginNode, public: |
229 | 293 |
230 // static | 294 // static |
231 std::wstring CookieTreeOriginNode::TitleForUrl( | 295 std::wstring CookieTreeOriginNode::TitleForUrl( |
232 const GURL& url) { | 296 const GURL& url) { |
233 return UTF8ToWide(url.SchemeIsFile() ? kFileOriginNodeName : url.host()); | 297 return UTF8ToWide(url.SchemeIsFile() ? kFileOriginNodeName : url.host()); |
234 } | 298 } |
235 | 299 |
236 CookieTreeOriginNode::CookieTreeOriginNode(const GURL& url) | 300 CookieTreeOriginNode::CookieTreeOriginNode(const GURL& url) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 return !url_.SchemeIsFile(); | 379 return !url_.SchemeIsFile(); |
316 } | 380 } |
317 | 381 |
318 /////////////////////////////////////////////////////////////////////////////// | 382 /////////////////////////////////////////////////////////////////////////////// |
319 // CookieTreeCookiesNode, public: | 383 // CookieTreeCookiesNode, public: |
320 | 384 |
321 CookieTreeCookiesNode::CookieTreeCookiesNode() | 385 CookieTreeCookiesNode::CookieTreeCookiesNode() |
322 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_COOKIES)) { | 386 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_COOKIES)) { |
323 } | 387 } |
324 | 388 |
| 389 CookieTreeCookiesNode::~CookieTreeCookiesNode() { |
| 390 } |
| 391 |
| 392 CookieTreeNode::DetailedInfo CookieTreeCookiesNode::GetDetailedInfo() const { |
| 393 return DetailedInfo(GetParent()->GetTitle(), |
| 394 DetailedInfo::TYPE_COOKIES, |
| 395 NULL, NULL, NULL, NULL, NULL, NULL); |
| 396 } |
| 397 |
325 /////////////////////////////////////////////////////////////////////////////// | 398 /////////////////////////////////////////////////////////////////////////////// |
326 // CookieTreeAppCachesNode, public: | 399 // CookieTreeAppCachesNode, public: |
327 | 400 |
328 CookieTreeAppCachesNode::CookieTreeAppCachesNode() | 401 CookieTreeAppCachesNode::CookieTreeAppCachesNode() |
329 : CookieTreeNode(l10n_util::GetStringUTF16( | 402 : CookieTreeNode(l10n_util::GetStringUTF16( |
330 IDS_COOKIES_APPLICATION_CACHES)) { | 403 IDS_COOKIES_APPLICATION_CACHES)) { |
331 } | 404 } |
332 | 405 |
| 406 CookieTreeAppCachesNode::~CookieTreeAppCachesNode() {} |
| 407 |
| 408 CookieTreeNode::DetailedInfo CookieTreeAppCachesNode::GetDetailedInfo() const { |
| 409 return DetailedInfo(GetParent()->GetTitle(), |
| 410 DetailedInfo::TYPE_APPCACHES, |
| 411 NULL, NULL, NULL, NULL, NULL, NULL); |
| 412 } |
| 413 |
333 /////////////////////////////////////////////////////////////////////////////// | 414 /////////////////////////////////////////////////////////////////////////////// |
334 // CookieTreeDatabasesNode, public: | 415 // CookieTreeDatabasesNode, public: |
335 | 416 |
336 CookieTreeDatabasesNode::CookieTreeDatabasesNode() | 417 CookieTreeDatabasesNode::CookieTreeDatabasesNode() |
337 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_WEB_DATABASES)) { | 418 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_WEB_DATABASES)) { |
338 } | 419 } |
339 | 420 |
| 421 CookieTreeDatabasesNode::~CookieTreeDatabasesNode() {} |
| 422 |
| 423 CookieTreeNode::DetailedInfo CookieTreeDatabasesNode::GetDetailedInfo() const { |
| 424 return DetailedInfo(GetParent()->GetTitle(), |
| 425 DetailedInfo::TYPE_DATABASES, |
| 426 NULL, NULL, NULL, NULL, NULL, NULL); |
| 427 } |
| 428 |
340 /////////////////////////////////////////////////////////////////////////////// | 429 /////////////////////////////////////////////////////////////////////////////// |
341 // CookieTreeLocalStoragesNode, public: | 430 // CookieTreeLocalStoragesNode, public: |
342 | 431 |
343 CookieTreeLocalStoragesNode::CookieTreeLocalStoragesNode() | 432 CookieTreeLocalStoragesNode::CookieTreeLocalStoragesNode() |
344 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE)) { | 433 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE)) { |
345 } | 434 } |
346 | 435 |
| 436 CookieTreeLocalStoragesNode::~CookieTreeLocalStoragesNode() {} |
| 437 |
| 438 CookieTreeNode::DetailedInfo |
| 439 CookieTreeLocalStoragesNode::GetDetailedInfo() const { |
| 440 return DetailedInfo(GetParent()->GetTitle(), |
| 441 DetailedInfo::TYPE_LOCAL_STORAGES, |
| 442 NULL, NULL, NULL, NULL, NULL, NULL); |
| 443 } |
| 444 |
347 /////////////////////////////////////////////////////////////////////////////// | 445 /////////////////////////////////////////////////////////////////////////////// |
348 // CookieTreeSessionStoragesNode, public: | 446 // CookieTreeSessionStoragesNode, public: |
349 | 447 |
350 CookieTreeSessionStoragesNode::CookieTreeSessionStoragesNode() | 448 CookieTreeSessionStoragesNode::CookieTreeSessionStoragesNode() |
351 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_SESSION_STORAGE)) { | 449 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_SESSION_STORAGE)) { |
352 } | 450 } |
353 | 451 |
| 452 CookieTreeSessionStoragesNode::~CookieTreeSessionStoragesNode() {} |
| 453 |
| 454 CookieTreeNode::DetailedInfo |
| 455 CookieTreeSessionStoragesNode::GetDetailedInfo() const { |
| 456 return DetailedInfo(GetParent()->GetTitle(), |
| 457 DetailedInfo::TYPE_SESSION_STORAGES, |
| 458 NULL, NULL, NULL, NULL, NULL, NULL); |
| 459 } |
| 460 |
354 /////////////////////////////////////////////////////////////////////////////// | 461 /////////////////////////////////////////////////////////////////////////////// |
355 // CookieTreeIndexedDBsNode, public: | 462 // CookieTreeIndexedDBsNode, public: |
356 | 463 |
357 CookieTreeIndexedDBsNode::CookieTreeIndexedDBsNode() | 464 CookieTreeIndexedDBsNode::CookieTreeIndexedDBsNode() |
358 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_INDEXED_DB)) { | 465 : CookieTreeNode(l10n_util::GetStringUTF16(IDS_COOKIES_INDEXED_DB)) { |
359 } | 466 } |
360 | 467 |
| 468 CookieTreeIndexedDBsNode::~CookieTreeIndexedDBsNode() {} |
| 469 |
| 470 CookieTreeNode::DetailedInfo |
| 471 CookieTreeIndexedDBsNode::GetDetailedInfo() const { |
| 472 return DetailedInfo(GetParent()->GetTitle(), |
| 473 DetailedInfo::TYPE_INDEXED_DBS, |
| 474 NULL, NULL, NULL, NULL, NULL, NULL); |
| 475 } |
| 476 |
361 /////////////////////////////////////////////////////////////////////////////// | 477 /////////////////////////////////////////////////////////////////////////////// |
362 // CookieTreeNode, protected | 478 // CookieTreeNode, protected |
363 | 479 |
364 bool CookieTreeNode::NodeTitleComparator::operator() ( | 480 bool CookieTreeNode::NodeTitleComparator::operator() ( |
365 const CookieTreeNode* lhs, const CookieTreeNode* rhs) { | 481 const CookieTreeNode* lhs, const CookieTreeNode* rhs) { |
366 const CookieTreeNode* left = | 482 const CookieTreeNode* left = |
367 static_cast<const CookieTreeNode*>(lhs); | 483 static_cast<const CookieTreeNode*>(lhs); |
368 const CookieTreeNode* right = | 484 const CookieTreeNode* right = |
369 static_cast<const CookieTreeNode*>(rhs); | 485 static_cast<const CookieTreeNode*>(rhs); |
370 return (left->GetTitle() < right->GetTitle()); | 486 return (left->GetTitle() < right->GetTitle()); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 858 |
743 void CookiesTreeModel::NotifyObserverEndBatch() { | 859 void CookiesTreeModel::NotifyObserverEndBatch() { |
744 // Only notify the observers if this is the outermost call to EndBatch() if | 860 // Only notify the observers if this is the outermost call to EndBatch() if |
745 // called in a nested manner. | 861 // called in a nested manner. |
746 if (--batch_update_ == 0) { | 862 if (--batch_update_ == 0) { |
747 FOR_EACH_OBSERVER(Observer, | 863 FOR_EACH_OBSERVER(Observer, |
748 cookies_observer_list_, | 864 cookies_observer_list_, |
749 TreeModelEndBatch(this)); | 865 TreeModelEndBatch(this)); |
750 } | 866 } |
751 } | 867 } |
OLD | NEW |