OLD | NEW |
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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 // If this is a new bookmark somewhere visible (e.g. on the bookmark | 103 // If this is a new bookmark somewhere visible (e.g. on the bookmark |
104 // bar), pulse it. Else, call ourself recursively with our parent | 104 // bar), pulse it. Else, call ourself recursively with our parent |
105 // until we find something visible to pulse. | 105 // until we find something visible to pulse. |
106 - (void)startPulsingBookmarkButton:(const BookmarkNode*)node { | 106 - (void)startPulsingBookmarkButton:(const BookmarkNode*)node { |
107 while (node) { | 107 while (node) { |
108 if ((node->parent() == model_->bookmark_bar_node()) || | 108 if ((node->parent() == model_->bookmark_bar_node()) || |
109 (node->parent() == client_->managed_node()) || | 109 (node->parent() == client_->managed_node()) || |
| 110 (node->parent() == client_->supervised_node()) || |
110 (node == model_->other_node())) { | 111 (node == model_->other_node())) { |
111 pulsingBookmarkNode_ = node; | 112 pulsingBookmarkNode_ = node; |
112 bookmarkObserver_->StartObservingNode(pulsingBookmarkNode_); | 113 bookmarkObserver_->StartObservingNode(pulsingBookmarkNode_); |
113 NSValue *value = [NSValue valueWithPointer:node]; | 114 NSValue *value = [NSValue valueWithPointer:node]; |
114 NSDictionary *dict = [NSDictionary | 115 NSDictionary *dict = [NSDictionary |
115 dictionaryWithObjectsAndKeys:value, | 116 dictionaryWithObjectsAndKeys:value, |
116 bookmark_button::kBookmarkKey, | 117 bookmark_button::kBookmarkKey, |
117 [NSNumber numberWithBool:YES], | 118 [NSNumber numberWithBool:YES], |
118 bookmark_button::kBookmarkPulseFlagKey, | 119 bookmark_button::kBookmarkPulseFlagKey, |
119 nil]; | 120 nil]; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 402 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
402 DCHECK(idx != -1); | 403 DCHECK(idx != -1); |
403 [folderPopUpButton_ selectItemAtIndex:idx]; | 404 [folderPopUpButton_ selectItemAtIndex:idx]; |
404 } | 405 } |
405 | 406 |
406 - (NSPopUpButton*)folderPopUpButton { | 407 - (NSPopUpButton*)folderPopUpButton { |
407 return folderPopUpButton_; | 408 return folderPopUpButton_; |
408 } | 409 } |
409 | 410 |
410 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 411 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
OLD | NEW |