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. 4 5#ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_ 6#define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_ 7 8#import <Cocoa/Cocoa.h> 9 10@class BookmarkButton; 11@protocol BookmarkButtonControllerProtocol; 12class BookmarkNode; 13class Profile; 14 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). 20// 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 25 Profile* profile_; 26} 27 28- (id)initWithController:(id<BookmarkButtonControllerProtocol>)controller 29 profile:(Profile*)profile; 30 31// Main IBAction for a button click. 32- (IBAction)openBookmarkFolderFromButton:(id)sender; 33 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; 39 40@end 41 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. 45extern NSString* kBookmarkButtonDragType; 46 47#endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_FOLDER_TARGET_CONTROLLER_H_ 48