| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_CO
COA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_CO
COA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_CO
COA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_CO
COA_H_ |
| 7 | 7 |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "chrome/browser/ui/extensions/extension_action_platform_delegate.h" | 9 #include "chrome/browser/ui/extensions/extension_action_platform_delegate.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 12 | 12 |
| 13 @class ExtensionPopupController; | 13 @class ExtensionPopupController; |
| 14 | 14 |
| 15 // The Cocoa-specific implementation for ExtensionActionPlatformDelegate. | 15 // The Cocoa-specific implementation for ExtensionActionPlatformDelegate. |
| 16 class ExtensionActionPlatformDelegateCocoa | 16 class ExtensionActionPlatformDelegateCocoa |
| 17 : public ExtensionActionPlatformDelegate, | 17 : public ExtensionActionPlatformDelegate, |
| 18 public content::NotificationObserver { | 18 public content::NotificationObserver { |
| 19 public: | 19 public: |
| 20 ExtensionActionPlatformDelegateCocoa( | 20 ExtensionActionPlatformDelegateCocoa( |
| 21 ExtensionActionViewController* controller); | 21 ExtensionActionViewController* controller); |
| 22 ~ExtensionActionPlatformDelegateCocoa() override; | 22 ~ExtensionActionPlatformDelegateCocoa() override; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // ExtensionActionPlatformDelegate: | 25 // ExtensionActionPlatformDelegate: |
| 26 bool IsMenuRunning() const override; | 26 bool IsMenuRunning() const override; |
| 27 void RegisterCommand() override; | 27 void RegisterCommand() override; |
| 28 void OnDelegateSet() override; | 28 void OnDelegateSet() override; |
| 29 extensions::ExtensionViewHost* ShowPopupWithUrl( | 29 void ShowPopup( |
| 30 ExtensionActionViewController::PopupShowAction show_action, | 30 scoped_ptr<extensions::ExtensionViewHost> host, |
| 31 const GURL& popup_url, | 31 bool grant_tab_permissions, |
| 32 bool grant_tab_permissions) override; | 32 ExtensionActionViewController::PopupShowAction show_action) override; |
| 33 void CloseOverflowMenu() override; |
| 33 | 34 |
| 34 // content::NotificationObserver: | 35 // content::NotificationObserver: |
| 35 void Observe(int type, | 36 void Observe(int type, |
| 36 const content::NotificationSource& source, | 37 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) override; | 38 const content::NotificationDetails& details) override; |
| 38 | 39 |
| 39 // Returns the point at which the popup should be shown. | 40 // Returns the point at which the popup should be shown. |
| 40 NSPoint GetPopupPoint() const; | 41 NSPoint GetPopupPoint() const; |
| 41 | 42 |
| 42 // The main controller for this extension action. | 43 // The main controller for this extension action. |
| 43 ExtensionActionViewController* controller_; | 44 ExtensionActionViewController* controller_; |
| 44 | 45 |
| 45 content::NotificationRegistrar registrar_; | 46 content::NotificationRegistrar registrar_; |
| 46 | 47 |
| 47 DISALLOW_COPY_AND_ASSIGN(ExtensionActionPlatformDelegateCocoa); | 48 DISALLOW_COPY_AND_ASSIGN(ExtensionActionPlatformDelegateCocoa); |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE
_COCOA_H_ | 51 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE
_COCOA_H_ |
| OLD | NEW |