OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_RENDERER_CONTEXT_SHARE_MENU_CONTROLLER |
| 6 #define CHROME_BROWSER_UI_COCOA_RENDERER_CONTEXT_SHARE_MENU_CONTROLLER |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #import "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/ui/browser.h" |
| 13 |
| 14 static NSString* kPageScreenShot = @"page_screen_shot"; |
| 15 static NSString* kPageUrl = @"page_url"; |
| 16 static NSString* kPageHtml = @"page_html"; |
| 17 |
| 18 namespace ShareMenuControllerInternal { |
| 19 class Observer; |
| 20 } |
| 21 |
| 22 @interface ShareMenuController : NSObject { |
| 23 @private |
| 24 __weak NSMenu* mainMenu_; |
| 25 scoped_ptr<ShareMenuControllerInternal::Observer> observer_; |
| 26 base::scoped_nsobject<NSMutableArray> shareItems_; |
| 27 NSMenuItem* shareMenuItem_; |
| 28 base::scoped_nsobject<NSMenu> shareSubMenu_; |
| 29 NSMenuItem* fileMenuItem_; |
| 30 BOOL menuItemsLoaded_; |
| 31 NSString* pageUrlForCurrentTab_; |
| 32 base::scoped_nsobject<NSImage> contentSnapShot_; |
| 33 base::scoped_nsobject<NSDictionary> pageInfo_; |
| 34 //base::scoped_nsobject<NSData> pageHtml_; |
| 35 base::scoped_nsobject<NSAttributedString> pageHtml_; |
| 36 base::scoped_nsobject<NSString> page_; |
| 37 base::scoped_nsobject<NSArray> originalSharableItems_; |
| 38 content::WebContents* pageContents_; |
| 39 Browser* lastActiveBrowser_; |
| 40 } |
| 41 |
| 42 - (id)initWithMainMenu:(NSMenu*)menu; |
| 43 - (BOOL)menuItemsLoaded; |
| 44 - (void)setPageContents:(content::WebContents*)contents; |
| 45 - (void)setActiveBrowser:(Browser*)browser; |
| 46 - (void)rebuildShareMenu; |
| 47 |
| 48 @end |
| 49 |
| 50 @interface ShareMenuController(PrivateShareMenuControllerTesting) |
| 51 - (void)initShareMenuItem; |
| 52 - (NSMenu*)shareSubMenu; |
| 53 - (NSMenuItem*)shareSubMenuItem; |
| 54 @end |
| 55 |
| 56 #endif // CHROME_BROWSER_UI_COCOA_RENDERER_CONTEXT_SHARE_MENU_CONTROLLER |
OLD | NEW |