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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 1302243002: [Mac] Remove kPulseBookmarkButtonNotification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarkeditor
Patch Set: Fix test. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
index 2fed9b9645ee72677b6a86613e97b982fb1a75a1..6cbd9f8d3934b2b385f952af8c4e66e1dd0321f2 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
@@ -101,52 +101,20 @@ using bookmarks::BookmarkNode;
}
}
-// If this is a new bookmark somewhere visible (e.g. on the bookmark
-// bar), pulse it. Else, call ourself recursively with our parent
-// until we find something visible to pulse.
- (void)startPulsingBookmarkButton:(const BookmarkNode*)node {
- while (node) {
- if ((node->parent() == model_->bookmark_bar_node()) ||
- (node->parent() ==
- managedBookmarkService_->managed_node()) ||
- (node->parent() == managedBookmarkService_->supervised_node()) ||
- (node == model_->other_node())) {
- pulsingBookmarkNode_ = node;
- bookmarkObserver_->StartObservingNode(pulsingBookmarkNode_);
- NSValue *value = [NSValue valueWithPointer:node];
- NSDictionary *dict = [NSDictionary
- dictionaryWithObjectsAndKeys:value,
- bookmark_button::kBookmarkKey,
- [NSNumber numberWithBool:YES],
- bookmark_button::kBookmarkPulseFlagKey,
- nil];
- [[NSNotificationCenter defaultCenter]
- postNotificationName:bookmark_button::kPulseBookmarkButtonNotification
- object:self
- userInfo:dict];
- return;
- }
- node = node->parent();
- }
+ pulsingBookmarkNode_ = [[[BrowserWindowController
+ browserWindowControllerForWindow:self.parentWindow] bookmarkBarController]
Alexei Svitkine (slow) 2015/08/24 14:43:41 Nit: Can you make a helper for getting the bookmar
+ startPulsingBookmarkNode:node];
+ bookmarkObserver_->StartObservingNode(pulsingBookmarkNode_);
}
- (void)stopPulsingBookmarkButton {
if (!pulsingBookmarkNode_)
return;
- NSValue *value = [NSValue valueWithPointer:pulsingBookmarkNode_];
- if (bookmarkObserver_)
- bookmarkObserver_->StopObservingNode(pulsingBookmarkNode_);
- pulsingBookmarkNode_ = NULL;
- NSDictionary *dict = [NSDictionary
- dictionaryWithObjectsAndKeys:value,
- bookmark_button::kBookmarkKey,
- [NSNumber numberWithBool:NO],
- bookmark_button::kBookmarkPulseFlagKey,
- nil];
- [[NSNotificationCenter defaultCenter]
- postNotificationName:bookmark_button::kPulseBookmarkButtonNotification
- object:self
- userInfo:dict];
+
+ [[[BrowserWindowController browserWindowControllerForWindow:self.parentWindow]
+ bookmarkBarController] stopPulsingBookmarkNode:pulsingBookmarkNode_];
+ pulsingBookmarkNode_ = nullptr;
}
// Close the bookmark bubble without changing anything. Unlike a
@@ -358,6 +326,10 @@ using bookmarks::BookmarkNode;
return syncPromoPlaceholder_;
}
+- (const BookmarkNode*)pulsingBookmarkNode {
+ return pulsingBookmarkNode_;
+}
+
+ (NSString*)chooseAnotherFolderString {
return l10n_util::GetNSStringWithFixup(
IDS_BOOKMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER);

Powered by Google App Engine
This is Rietveld 408576698