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
;
15 // Target (in the target/action sense) of a bookmark folder button.
16 // Since ObjC doesn't have multiple inheritance we use has-a instead
17 // of is-a to share behavior between the BookmarkBarFolderController
18 // (NSWindowController) and the BookmarkBarController
19 // (NSViewController).
21 // This class is unit tested in the context of a BookmarkBarController.
22 @interface BookmarkFolderTarget
: NSObject
{
23 // The owner of the bookmark folder button
24 id
<BookmarkButtonControllerProtocol
> controller_
; // weak
28 - (id
)initWithController
:(id
<BookmarkButtonControllerProtocol
>)controller
29 profile
:(Profile
*)profile
;
31 // Main IBAction for a button click.
32 - (IBAction
)openBookmarkFolderFromButton
:(id
)sender
;
34 // Fill the given pasteboard with appropriate data when the given button is
35 // dragged. Since the delegate has no way of providing pasteboard data later,
36 // all data must actually be put into the pasteboard and not merely promised.
37 - (void)fillPasteboard
:(NSPasteboard
*)pboard
38 forDragOfButton
:(BookmarkButton
*)button
;
42 // The (internal) |NSPasteboard| type string for bookmark button drags, used for
43 // dragging buttons around the bookmark bar. The data for this type is just a
44 // pointer to the |BookmarkButton| being dragged.
45 extern NSString
* kBookmarkButtonDragType
;
47 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_