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