Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| index fb0a9e16e934e00f403e28a473f1803cd7b2dd58..fe9ecd3f0c19facf997718588666596ac7051aab 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| @@ -51,6 +51,7 @@ |
| #include "components/autofill/core/common/password_form.h" |
| #include "content/public/browser/native_web_keyboard_event.h" |
| #include "content/public/browser/notification_details.h" |
| +#include "content/public/browser/notification_service.h" |
| #include "content/public/browser/notification_source.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_view.h" |
| @@ -756,12 +757,42 @@ BrowserWindowCocoa::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
| return 0; |
| } |
| +void BrowserWindowCocoa::ShowExtensionActionPopup( |
| + extensions::CommandService::ExtensionCommandType type, |
| + std::string extension_id) { |
| + // Set the notification type. |
| + int notification_type; |
|
Robert Sesek
2014/02/26 18:05:13
Initialize this since you do not have a default: c
erikchen
2014/02/26 19:58:23
method was removed.
On 2014/02/26 18:05:13, rsese
|
| + switch (type) { |
| + case extensions::CommandService::NAMED: |
| + NOTREACHED(); |
| + return; |
| + case extensions::CommandService::BROWSER_ACTION: |
| + notification_type = |
| + chrome::NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC; |
| + break; |
| + case extensions::CommandService::PAGE_ACTION: |
| + notification_type = |
| + chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC; |
| + break; |
| + } |
| + // Dispatch a notification, which triggers the popup. |
| + std::pair<const std::string, gfx::NativeWindow> details = |
| + std::make_pair(extension_id, window()); |
| + content::NotificationService::current()->Notify( |
|
Robert Sesek
2014/02/26 18:05:13
There's an active effort to remove notifications f
erikchen
2014/02/26 19:58:23
certainly. I've plumbed through the necessary logi
|
| + notification_type, |
| + content::Source<Profile>(browser_->profile()), |
| + content::Details<std::pair<const std::string, gfx::NativeWindow> >( |
| + &details)); |
| +} |
| + |
| void BrowserWindowCocoa::ShowPageActionPopup( |
| const extensions::Extension* extension) { |
| - NOTIMPLEMENTED(); |
| + ShowExtensionActionPopup(extensions::CommandService::PAGE_ACTION, |
| + extension->id()); |
| } |
| void BrowserWindowCocoa::ShowBrowserActionPopup( |
| const extensions::Extension* extension) { |
| - NOTIMPLEMENTED(); |
| + ShowExtensionActionPopup(extensions::CommandService::BROWSER_ACTION, |
| + extension->id()); |
| } |