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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/utf_string_conversions.h" // TODO(viettrungluu): remove 9 #include "base/utf_string_conversions.h" // TODO(viettrungluu): remove
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 22 matching lines...) Expand all
33 NotificationRegistrar registrar_; 33 NotificationRegistrar registrar_;
34 BookmarkBubbleController* controller_; // weak; owns us. 34 BookmarkBubbleController* controller_; // weak; owns us.
35 SEL selector_; // SEL sent to controller_ on notification. 35 SEL selector_; // SEL sent to controller_ on notification.
36 }; 36 };
37 37
38 BookmarkBubbleNotificationBridge::BookmarkBubbleNotificationBridge( 38 BookmarkBubbleNotificationBridge::BookmarkBubbleNotificationBridge(
39 BookmarkBubbleController* controller, SEL selector) 39 BookmarkBubbleController* controller, SEL selector)
40 : controller_(controller), selector_(selector) { 40 : controller_(controller), selector_(selector) {
41 // registrar_ will automatically RemoveAll() when destroyed so we 41 // registrar_ will automatically RemoveAll() when destroyed so we
42 // don't need to do so explicitly. 42 // don't need to do so explicitly.
43 registrar_.Add(this, NotificationType::TAB_CONTENTS_CONNECTED, 43 registrar_.Add(this, chrome::TAB_CONTENTS_CONNECTED,
44 NotificationService::AllSources()); 44 NotificationService::AllSources());
45 registrar_.Add(this, NotificationType::TAB_CLOSED, 45 registrar_.Add(this, chrome::TAB_CLOSED,
46 NotificationService::AllSources()); 46 NotificationService::AllSources());
47 } 47 }
48 48
49 // At this time all notifications instigate the same behavior (go 49 // At this time all notifications instigate the same behavior (go
50 // away) so we don't bother checking which notification came in. 50 // away) so we don't bother checking which notification came in.
51 void BookmarkBubbleNotificationBridge::Observe( 51 void BookmarkBubbleNotificationBridge::Observe(
52 NotificationType type, 52 NotificationType type,
53 const NotificationSource& source, 53 const NotificationSource& source,
54 const NotificationDetails& details) { 54 const NotificationDetails& details) {
55 [controller_ performSelector:selector_ withObject:controller_]; 55 [controller_ performSelector:selector_ withObject:controller_];
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; 414 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
415 DCHECK(idx != -1); 415 DCHECK(idx != -1);
416 [folderPopUpButton_ selectItemAtIndex:idx]; 416 [folderPopUpButton_ selectItemAtIndex:idx];
417 } 417 }
418 418
419 - (NSPopUpButton*)folderPopUpButton { 419 - (NSPopUpButton*)folderPopUpButton {
420 return folderPopUpButton_; 420 return folderPopUpButton_;
421 } 421 }
422 422
423 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) 423 @end // implementation BookmarkBubbleController(ExposedForUnitTesting)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698