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/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 SEL selector_; // SEL sent to controller_ on notification. | 39 SEL selector_; // SEL sent to controller_ on notification. |
40 }; | 40 }; |
41 | 41 |
42 BookmarkBubbleNotificationBridge::BookmarkBubbleNotificationBridge( | 42 BookmarkBubbleNotificationBridge::BookmarkBubbleNotificationBridge( |
43 BookmarkBubbleController* controller, SEL selector) | 43 BookmarkBubbleController* controller, SEL selector) |
44 : controller_(controller), selector_(selector) { | 44 : controller_(controller), selector_(selector) { |
45 // registrar_ will automatically RemoveAll() when destroyed so we | 45 // registrar_ will automatically RemoveAll() when destroyed so we |
46 // don't need to do so explicitly. | 46 // don't need to do so explicitly. |
47 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | 47 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
48 content::NotificationService::AllSources()); | 48 content::NotificationService::AllSources()); |
49 registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, | 49 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
50 content::NotificationService::AllSources()); | 50 content::NotificationService::AllSources()); |
51 } | 51 } |
52 | 52 |
53 // At this time all notifications instigate the same behavior (go | 53 // At this time all notifications instigate the same behavior (go |
54 // away) so we don't bother checking which notification came in. | 54 // away) so we don't bother checking which notification came in. |
55 void BookmarkBubbleNotificationBridge::Observe( | 55 void BookmarkBubbleNotificationBridge::Observe( |
56 int type, | 56 int type, |
57 const content::NotificationSource& source, | 57 const content::NotificationSource& source, |
58 const content::NotificationDetails& details) { | 58 const content::NotificationDetails& details) { |
59 [controller_ performSelector:selector_ withObject:controller_]; | 59 [controller_ performSelector:selector_ withObject:controller_]; |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 400 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
401 DCHECK(idx != -1); | 401 DCHECK(idx != -1); |
402 [folderPopUpButton_ selectItemAtIndex:idx]; | 402 [folderPopUpButton_ selectItemAtIndex:idx]; |
403 } | 403 } |
404 | 404 |
405 - (NSPopUpButton*)folderPopUpButton { | 405 - (NSPopUpButton*)folderPopUpButton { |
406 return folderPopUpButton_; | 406 return folderPopUpButton_; |
407 } | 407 } |
408 | 408 |
409 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 409 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
OLD | NEW |