OLD | NEW |
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_storage.h" | 8 #include "chrome/browser/bookmarks/bookmark_storage.h" |
9 #include "chrome/browser/history/query_parser.h" | 9 #include "chrome/browser/history/query_parser.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // BookmarkModel -------------------------------------------------------------- | 71 // BookmarkModel -------------------------------------------------------------- |
72 | 72 |
73 BookmarkModel::BookmarkModel(Profile* profile) | 73 BookmarkModel::BookmarkModel(Profile* profile) |
74 : profile_(profile), | 74 : profile_(profile), |
75 loaded_(false), | 75 loaded_(false), |
76 #pragma warning(suppress: 4355) // Okay to pass "this" here. | 76 #pragma warning(suppress: 4355) // Okay to pass "this" here. |
77 root_(this, GURL()), | 77 root_(this, GURL()), |
78 bookmark_bar_node_(NULL), | 78 bookmark_bar_node_(NULL), |
79 other_node_(NULL), | 79 other_node_(NULL), |
| 80 observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), |
80 waiting_for_history_load_(false), | 81 waiting_for_history_load_(false), |
81 loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) { | 82 loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) { |
82 // Create the bookmark bar and other bookmarks folders. These always exist. | 83 // Create the bookmark bar and other bookmarks folders. These always exist. |
83 CreateBookmarkNode(); | 84 CreateBookmarkNode(); |
84 CreateOtherBookmarksNode(); | 85 CreateOtherBookmarksNode(); |
85 | 86 |
86 // And add them to the root. | 87 // And add them to the root. |
87 // | 88 // |
88 // WARNING: order is important here, various places assume bookmark bar then | 89 // WARNING: order is important here, various places assume bookmark bar then |
89 // other node. | 90 // other node. |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } | 772 } |
772 | 773 |
773 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { | 774 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { |
774 // NOTE: this is called with url_lock_ already held. As such, this doesn't | 775 // NOTE: this is called with url_lock_ already held. As such, this doesn't |
775 // explicitly grab the lock. | 776 // explicitly grab the lock. |
776 if (node->is_url()) | 777 if (node->is_url()) |
777 nodes_ordered_by_url_set_.insert(node); | 778 nodes_ordered_by_url_set_.insert(node); |
778 for (int i = 0; i < node->GetChildCount(); ++i) | 779 for (int i = 0; i < node->GetChildCount(); ++i) |
779 PopulateNodesByURL(node->GetChild(i)); | 780 PopulateNodesByURL(node->GetChild(i)); |
780 } | 781 } |
OLD | NEW |