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

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

Issue 12310153: bookmarks: Remove bookmark loaded notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « no previous file | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/json/json_string_value_serializer.h" 12 #include "base/json/json_string_value_serializer.h"
13 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" 17 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h"
18 #include "chrome/browser/bookmarks/bookmark_index.h" 18 #include "chrome/browser/bookmarks/bookmark_index.h"
19 #include "chrome/browser/bookmarks/bookmark_model_observer.h" 19 #include "chrome/browser/bookmarks/bookmark_model_observer.h"
20 #include "chrome/browser/bookmarks/bookmark_storage.h" 20 #include "chrome/browser/bookmarks/bookmark_storage.h"
21 #include "chrome/browser/bookmarks/bookmark_utils.h" 21 #include "chrome/browser/bookmarks/bookmark_utils.h"
22 #include "chrome/browser/favicon/favicon_service.h" 22 #include "chrome/browser/favicon/favicon_service.h"
23 #include "chrome/browser/favicon/favicon_service_factory.h" 23 #include "chrome/browser/favicon/favicon_service_factory.h"
24 #include "chrome/browser/history/history_notifications.h" 24 #include "chrome/browser/history/history_notifications.h"
25 #include "chrome/browser/history/history_service.h" 25 #include "chrome/browser/history/history_service.h"
26 #include "chrome/browser/history/history_service_factory.h" 26 #include "chrome/browser/history/history_service_factory.h"
27 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/common/chrome_notification_types.h" 28 #include "chrome/common/chrome_notification_types.h"
29 #include "content/public/browser/content_browser_client.h" 29 #include "content/public/browser/content_browser_client.h"
30 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_source.h"
31 #include "grit/generated_resources.h" 32 #include "grit/generated_resources.h"
32 #include "ui/base/l10n/l10n_util.h" 33 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/l10n/l10n_util_collator.h" 34 #include "ui/base/l10n/l10n_util_collator.h"
34 #include "ui/gfx/favicon_size.h" 35 #include "ui/gfx/favicon_size.h"
35 #include "ui/gfx/image/image_util.h" 36 #include "ui/gfx/image/image_util.h"
36 37
37 using base::Time; 38 using base::Time;
38 39
39 namespace { 40 namespace {
40 41
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 PopulateNodesByURL(&root_); 738 PopulateNodesByURL(&root_);
738 } 739 }
739 740
740 loaded_ = true; 741 loaded_ = true;
741 742
742 loaded_signal_.Signal(); 743 loaded_signal_.Signal();
743 744
744 // Notify our direct observers. 745 // Notify our direct observers.
745 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 746 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
746 Loaded(this, details->ids_reassigned())); 747 Loaded(this, details->ids_reassigned()));
747
748 // And generic notification.
749 content::NotificationService::current()->Notify(
750 chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
751 content::Source<content::BrowserContext>(profile_),
752 content::NotificationService::NoDetails());
753 } 748 }
754 749
755 void BookmarkModel::RemoveAndDeleteNode(BookmarkNode* delete_me) { 750 void BookmarkModel::RemoveAndDeleteNode(BookmarkNode* delete_me) {
756 scoped_ptr<BookmarkNode> node(delete_me); 751 scoped_ptr<BookmarkNode> node(delete_me);
757 752
758 BookmarkNode* parent = AsMutable(node->parent()); 753 BookmarkNode* parent = AsMutable(node->parent());
759 DCHECK(parent); 754 DCHECK(parent);
760 int index = parent->GetIndexOf(node.get()); 755 int index = parent->GetIndexOf(node.get());
761 parent->Remove(node.get()); 756 parent->Remove(node.get());
762 std::set<GURL> changed_urls; 757 std::set<GURL> changed_urls;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 BookmarkPermanentNode* bb_node = 954 BookmarkPermanentNode* bb_node =
960 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); 955 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR);
961 BookmarkPermanentNode* other_node = 956 BookmarkPermanentNode* other_node =
962 CreatePermanentNode(BookmarkNode::OTHER_NODE); 957 CreatePermanentNode(BookmarkNode::OTHER_NODE);
963 BookmarkPermanentNode* mobile_node = 958 BookmarkPermanentNode* mobile_node =
964 CreatePermanentNode(BookmarkNode::MOBILE); 959 CreatePermanentNode(BookmarkNode::MOBILE);
965 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, 960 return new BookmarkLoadDetails(bb_node, other_node, mobile_node,
966 new BookmarkIndex(profile_), 961 new BookmarkIndex(profile_),
967 next_node_id_); 962 next_node_id_);
968 } 963 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698