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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 14471: Attempt 2 at this. This differs from first version in that I renamed... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include "base/gfx/png_decoder.h" 7 #include "base/gfx/png_decoder.h"
8 #include "chrome/browser/bookmarks/bookmark_utils.h" 8 #include "chrome/browser/bookmarks/bookmark_utils.h"
9 #include "chrome/browser/bookmarks/bookmark_storage.h" 9 #include "chrome/browser/bookmarks/bookmark_storage.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 BookmarkNode* node = bookmarks[i]; 314 BookmarkNode* node = bookmarks[i];
315 Remove(node->GetParent(), node->GetParent()->IndexOfChild(node)); 315 Remove(node->GetParent(), node->GetParent()->IndexOfChild(node));
316 } 316 }
317 } 317 }
318 } 318 }
319 319
320 void BookmarkModel::ResetDateGroupModified(BookmarkNode* node) { 320 void BookmarkModel::ResetDateGroupModified(BookmarkNode* node) {
321 SetDateGroupModified(node, Time()); 321 SetDateGroupModified(node, Time());
322 } 322 }
323 323
324 void BookmarkModel::ClearStore() {
325 if (profile_ && store_.get()) {
326 NotificationService::current()->RemoveObserver(
327 this, NOTIFY_FAVICON_CHANGED, Source<Profile>(profile_));
328 }
329 store_ = NULL;
330 }
331
324 bool BookmarkModel::IsBookmarkedNoLock(const GURL& url) { 332 bool BookmarkModel::IsBookmarkedNoLock(const GURL& url) {
325 BookmarkNode tmp_node(this, url); 333 BookmarkNode tmp_node(this, url);
326 return (nodes_ordered_by_url_set_.find(&tmp_node) != 334 return (nodes_ordered_by_url_set_.find(&tmp_node) !=
327 nodes_ordered_by_url_set_.end()); 335 nodes_ordered_by_url_set_.end());
328 } 336 }
329 337
330 void BookmarkModel::FavIconLoaded(BookmarkNode* node) { 338 void BookmarkModel::FavIconLoaded(BookmarkNode* node) {
331 // Send out notification to the observer. 339 // Send out notification to the observer.
332 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 340 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
333 BookmarkNodeFavIconLoaded(this, node)); 341 BookmarkNodeFavIconLoaded(this, node));
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 665 }
658 666
659 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { 667 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) {
660 // NOTE: this is called with url_lock_ already held. As such, this doesn't 668 // NOTE: this is called with url_lock_ already held. As such, this doesn't
661 // explicitly grab the lock. 669 // explicitly grab the lock.
662 if (node->is_url()) 670 if (node->is_url())
663 nodes_ordered_by_url_set_.insert(node); 671 nodes_ordered_by_url_set_.insert(node);
664 for (int i = 0; i < node->GetChildCount(); ++i) 672 for (int i = 0; i < node->GetChildCount(); ++i)
665 PopulateNodesByURL(node->GetChild(i)); 673 PopulateNodesByURL(node->GetChild(i));
666 } 674 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.h ('k') | chrome/browser/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698