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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h" |
11 | 11 |
12 @class BookmarkBubbleController; | 12 @class BookmarkBubbleController; |
13 @class BookmarkSyncPromoController; | 13 @class BookmarkSyncPromoController; |
14 | 14 |
15 namespace bookmarks { | 15 namespace bookmarks { |
| 16 class BookmarkBubbleObserver; |
16 class BookmarkModel; | 17 class BookmarkModel; |
17 class BookmarkNode; | 18 class BookmarkNode; |
18 class ManagedBookmarkService; | 19 class ManagedBookmarkService; |
19 } | 20 } |
20 | 21 |
21 // Controller for the bookmark bubble. The bookmark bubble is a | 22 // Controller for the bookmark bubble. The bookmark bubble is a |
22 // bubble that pops up when clicking on the STAR next to the URL to | 23 // bubble that pops up when clicking on the STAR next to the URL to |
23 // add or remove it as a bookmark. This bubble allows for editing of | 24 // add or remove it as a bookmark. This bubble allows for editing of |
24 // the bookmark in various ways (name, folder, etc.) | 25 // the bookmark in various ways (name, folder, etc.) |
25 @interface BookmarkBubbleController : BaseBubbleController { | 26 @interface BookmarkBubbleController : BaseBubbleController { |
26 @private | 27 @private |
27 // |managed_|, |model_| and |node_| are weak and owned by the current | 28 // |managed_|, |model_| and |node_| are weak and owned by the current |
28 // browser's profile. | 29 // browser's profile. |
29 bookmarks::ManagedBookmarkService* managedBookmarkService_; // weak | 30 bookmarks::ManagedBookmarkService* managedBookmarkService_; // weak |
30 bookmarks::BookmarkModel* model_; // weak | 31 bookmarks::BookmarkModel* model_; // weak |
31 const bookmarks::BookmarkNode* node_; // weak | 32 const bookmarks::BookmarkNode* node_; // weak |
32 | 33 |
33 // The bookmark node whose button we asked to pulse. | 34 // The bookmark node whose button we asked to pulse. |
34 const bookmarks::BookmarkNode* pulsingBookmarkNode_; // weak | 35 const bookmarks::BookmarkNode* pulsingBookmarkNode_; // weak |
35 | 36 |
36 BOOL alreadyBookmarked_; | 37 BOOL alreadyBookmarked_; |
37 | 38 |
38 // Ping me when the bookmark model changes out from under us. | 39 // Ping me when the bookmark model changes out from under us. |
39 scoped_ptr<BookmarkModelObserverForCocoa> bookmarkObserver_; | 40 scoped_ptr<BookmarkModelObserverForCocoa> bookmarkObserver_; |
40 | 41 |
| 42 // Observer when showing a toolkit-views bubble. |
| 43 scoped_ptr<bookmarks::BookmarkBubbleObserver> bookmarkBubbleObserver_; |
| 44 |
41 // Sync promo controller, if the sync promo is displayed. | 45 // Sync promo controller, if the sync promo is displayed. |
42 base::scoped_nsobject<BookmarkSyncPromoController> syncPromoController_; | 46 base::scoped_nsobject<BookmarkSyncPromoController> syncPromoController_; |
43 | 47 |
44 IBOutlet NSTextField* bigTitle_; // "Bookmark" or "Bookmark Added!" | 48 IBOutlet NSTextField* bigTitle_; // "Bookmark" or "Bookmark Added!" |
45 IBOutlet NSTextField* nameTextField_; | 49 IBOutlet NSTextField* nameTextField_; |
46 IBOutlet NSPopUpButton* folderPopUpButton_; | 50 IBOutlet NSPopUpButton* folderPopUpButton_; |
47 IBOutlet NSView* syncPromoPlaceholder_; | 51 IBOutlet NSView* syncPromoPlaceholder_; |
48 } | 52 } |
49 | 53 |
50 @property(readonly, nonatomic) const bookmarks::BookmarkNode* node; | 54 @property(readonly, nonatomic) const bookmarks::BookmarkNode* node; |
(...skipping 29 matching lines...) Expand all Loading... |
80 | 84 |
81 - (void)addFolderNodes:(const bookmarks::BookmarkNode*)parent | 85 - (void)addFolderNodes:(const bookmarks::BookmarkNode*)parent |
82 toPopUpButton:(NSPopUpButton*)button | 86 toPopUpButton:(NSPopUpButton*)button |
83 indentation:(int)indentation; | 87 indentation:(int)indentation; |
84 - (void)setTitle:(NSString*)title | 88 - (void)setTitle:(NSString*)title |
85 parentFolder:(const bookmarks::BookmarkNode*)parent; | 89 parentFolder:(const bookmarks::BookmarkNode*)parent; |
86 - (void)setParentFolderSelection:(const bookmarks::BookmarkNode*)parent; | 90 - (void)setParentFolderSelection:(const bookmarks::BookmarkNode*)parent; |
87 + (NSString*)chooseAnotherFolderString; | 91 + (NSString*)chooseAnotherFolderString; |
88 - (NSPopUpButton*)folderPopUpButton; | 92 - (NSPopUpButton*)folderPopUpButton; |
89 @end | 93 @end |
OLD | NEW |