Index: chrome/browser/app_controller_mac.mm |
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm |
index 91ae93205314708c7dc9ade72d85264fe460c0f9..8cda1ac73d8e996403e71703e76a405fa7fa108b 100644 |
--- a/chrome/browser/app_controller_mac.mm |
+++ b/chrome/browser/app_controller_mac.mm |
@@ -66,6 +66,7 @@ |
#import "chrome/browser/ui/cocoa/history_menu_bridge.h" |
#include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" |
#import "chrome/browser/ui/cocoa/profiles/profile_menu_controller.h" |
+#import "chrome/browser/ui/cocoa/renderer_context_menu/share_menu_controller.h" |
#include "chrome/browser/ui/extensions/application_launch.h" |
#include "chrome/browser/ui/host_desktop.h" |
#include "chrome/browser/ui/startup/startup_browser_creator.h" |
@@ -207,10 +208,12 @@ bool IsProfileSignedOut(Profile* profile) { |
} // namespace |
-@interface AppController () <HandoffActiveURLObserverBridgeDelegate> |
+@interface AppController () <HandoffActiveURLObserverBridgeDelegate, |
+ NSSharingServiceDelegate> |
- (void)initMenuState; |
- (void)initProfileMenu; |
+- (void)initShareMenu; |
- (void)updateConfirmToQuitPrefMenuItem:(NSMenuItem*)item; |
- (void)updateDisplayMessageCenterPrefMenuItem:(NSMenuItem*)item; |
- (void)registerServicesMenuTypesTo:(NSApplication*)app; |
@@ -223,6 +226,7 @@ bool IsProfileSignedOut(Profile* profile) { |
- (void)executeApplication:(id)sender; |
- (void)profileWasRemoved:(const base::FilePath&)profilePath; |
+ |
Avi (use Gerrit)
2015/05/05 18:47:50
remove this extra line.
|
// Opens a tab for each GURL in |urls|. |
- (void)openUrls:(const std::vector<GURL>&)urls; |
@@ -388,6 +392,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { |
// Initialize the Profile menu. |
[self initProfileMenu]; |
+ |
+ // Initialize the Share Menu |
Avi (use Gerrit)
2015/05/05 18:47:50
period at the end; complete sentences, please.
|
+ [self initShareMenu]; |
} |
- (void)unregisterEventHandlers { |
@@ -603,8 +610,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { |
- (void)windowDidBecomeMain:(NSNotification*)notify { |
Browser* browser = chrome::FindBrowserWithWindow([notify object]); |
shrike
2015/05/05 18:20:22
Seems like this change is two lines being indented
|
- if (browser) |
- [self windowChangedToProfile:browser->profile()->GetOriginalProfile()]; |
+ if (browser) |
+ [self windowChangedToProfile:browser->profile()->GetOriginalProfile()]; |
} |
- (void)windowDidResignMain:(NSNotification*)notify { |
@@ -1311,6 +1318,13 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { |
[[ProfileMenuController alloc] initWithMainMenuItem:profileMenu]); |
} |
+- (void) initShareMenu { |
Avi (use Gerrit)
2015/05/05 18:47:50
no space after )
|
+ NSMenu* mainMenu = [NSApp mainMenu]; |
+ |
+ shareMenuController_.reset( |
+ [[ShareMenuController alloc] initWithMainMenu:mainMenu]); |
Avi (use Gerrit)
2015/05/05 18:47:50
Why are you passing in the main menu? Why wouldn't
|
+} |
+ |
// The Confirm to Quit preference is atypical in that the preference lives in |
// the app menu right above the Quit menu item. This method will refresh the |
// display of that item depending on the preference state. |