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/bookmark_bar_model.h" | 5 #include "chrome/browser/bookmark_bar_model.h" |
6 | 6 |
7 #include "base/gfx/png_decoder.h" | 7 #include "base/gfx/png_decoder.h" |
8 #include "chrome/browser/history/query_parser.h" | 8 #include "chrome/browser/history/query_parser.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/bookmark_storage.h" | 10 #include "chrome/browser/bookmark_storage.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (profile_ && store_.get()) { | 97 if (profile_ && store_.get()) { |
98 NotificationService::current()->RemoveObserver( | 98 NotificationService::current()->RemoveObserver( |
99 this, NOTIFY_FAVICON_CHANGED, Source<Profile>(profile_)); | 99 this, NOTIFY_FAVICON_CHANGED, Source<Profile>(profile_)); |
100 } | 100 } |
101 | 101 |
102 if (waiting_for_history_load_) { | 102 if (waiting_for_history_load_) { |
103 NotificationService::current()->RemoveObserver( | 103 NotificationService::current()->RemoveObserver( |
104 this, NOTIFY_HISTORY_LOADED, Source<Profile>(profile_)); | 104 this, NOTIFY_HISTORY_LOADED, Source<Profile>(profile_)); |
105 } | 105 } |
106 | 106 |
| 107 FOR_EACH_OBSERVER(BookmarkBarModelObserver, observers_, |
| 108 BookmarkModelBeingDeleted(this)); |
| 109 |
107 if (store_) { | 110 if (store_) { |
108 // The store maintains a reference back to us. We need to tell it we're gone | 111 // The store maintains a reference back to us. We need to tell it we're gone |
109 // so that it doesn't try and invoke a method back on us again. | 112 // so that it doesn't try and invoke a method back on us again. |
110 store_->BookmarkModelDeleted(); | 113 store_->BookmarkModelDeleted(); |
111 } | 114 } |
112 } | 115 } |
113 | 116 |
114 void BookmarkBarModel::Load() { | 117 void BookmarkBarModel::Load() { |
115 if (store_.get()) { | 118 if (store_.get()) { |
116 // If the store is non-null, it means Load was already invoked. Load should | 119 // If the store is non-null, it means Load was already invoked. Load should |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 } | 685 } |
683 | 686 |
684 void BookmarkBarModel::PopulateNodesByURL(BookmarkBarNode* node) { | 687 void BookmarkBarModel::PopulateNodesByURL(BookmarkBarNode* node) { |
685 // NOTE: this is called with url_lock_ already held. As such, this doesn't | 688 // NOTE: this is called with url_lock_ already held. As such, this doesn't |
686 // explicitly grab the lock. | 689 // explicitly grab the lock. |
687 if (node->is_url()) | 690 if (node->is_url()) |
688 nodes_ordered_by_url_set_.insert(node); | 691 nodes_ordered_by_url_set_.insert(node); |
689 for (int i = 0; i < node->GetChildCount(); ++i) | 692 for (int i = 0; i < node->GetChildCount(); ++i) |
690 PopulateNodesByURL(node->GetChild(i)); | 693 PopulateNodesByURL(node->GetChild(i)); |
691 } | 694 } |
OLD | NEW |