1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 @
class BookmarkButton
;
11 @protocol BookmarkButtonControllerProtocol
;
14 // Target (in the target/action sense) of a bookmark folder button.
15 // Since ObjC doesn't have multiple inheritance we use has-a instead
16 // of is-a to share behavior between the BookmarkBarFolderController
17 // (NSWindowController) and the BookmarkBarController
18 // (NSViewController).
20 // This class is unit tested in the context of a BookmarkBarController.
21 @interface BookmarkFolderTarget
: NSObject
{
22 // The owner of the bookmark folder button
23 id
<BookmarkButtonControllerProtocol
> controller_
; // weak
27 - (id
)initWithController
:(id
<BookmarkButtonControllerProtocol
>)controller
28 profile
:(Profile
*)profile
;
30 // Main IBAction for a button click.
31 - (IBAction
)openBookmarkFolderFromButton
:(id
)sender
;
33 // Fill the given pasteboard with appropriate data when the given button is
34 // dragged. Since the delegate has no way of providing pasteboard data later,
35 // all data must actually be put into the pasteboard and not merely promised.
36 - (void)fillPasteboard
:(NSPasteboard
*)pboard
37 forDragOfButton
:(BookmarkButton
*)button
;
41 // The (internal) |NSPasteboard| type string for bookmark button drags, used for
42 // dragging buttons around the bookmark bar. The data for this type is just a
43 // pointer to the |BookmarkButton| being dragged.
44 extern NSString
* kBookmarkButtonDragType
;
46 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_