| 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_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_VI
EWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_VI
EWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_VI
EWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_VI
EWS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public ui::AcceleratorTarget { | 27 public ui::AcceleratorTarget { |
| 28 public: | 28 public: |
| 29 ExtensionActionPlatformDelegateViews( | 29 ExtensionActionPlatformDelegateViews( |
| 30 ExtensionActionViewController* controller); | 30 ExtensionActionViewController* controller); |
| 31 ~ExtensionActionPlatformDelegateViews() override; | 31 ~ExtensionActionPlatformDelegateViews() override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // ExtensionActionPlatformDelegate: | 34 // ExtensionActionPlatformDelegate: |
| 35 void RegisterCommand() override; | 35 void RegisterCommand() override; |
| 36 void ShowPopup( | 36 void ShowPopup( |
| 37 scoped_ptr<extensions::ExtensionViewHost> host, | 37 std::unique_ptr<extensions::ExtensionViewHost> host, |
| 38 bool grant_tab_permissions, | 38 bool grant_tab_permissions, |
| 39 ExtensionActionViewController::PopupShowAction show_action) override; | 39 ExtensionActionViewController::PopupShowAction show_action) override; |
| 40 void CloseOverflowMenu() override; | 40 void CloseOverflowMenu() override; |
| 41 void ShowContextMenu() override; | 41 void ShowContextMenu() override; |
| 42 | 42 |
| 43 // content::NotificationObserver: | 43 // content::NotificationObserver: |
| 44 void Observe(int type, | 44 void Observe(int type, |
| 45 const content::NotificationSource& source, | 45 const content::NotificationSource& source, |
| 46 const content::NotificationDetails& details) override; | 46 const content::NotificationDetails& details) override; |
| 47 | 47 |
| 48 // ui::AcceleratorTarget: | 48 // ui::AcceleratorTarget: |
| 49 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 49 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 50 bool CanHandleAccelerators() const override; | 50 bool CanHandleAccelerators() const override; |
| 51 | 51 |
| 52 // Unregisters the accelerator for the extension action's command, if one | 52 // Unregisters the accelerator for the extension action's command, if one |
| 53 // exists. If |only_if_removed| is true, then this will only unregister if the | 53 // exists. If |only_if_removed| is true, then this will only unregister if the |
| 54 // command has been removed. | 54 // command has been removed. |
| 55 void UnregisterCommand(bool only_if_removed); | 55 void UnregisterCommand(bool only_if_removed); |
| 56 | 56 |
| 57 ToolbarActionViewDelegateViews* GetDelegateViews() const; | 57 ToolbarActionViewDelegateViews* GetDelegateViews() const; |
| 58 | 58 |
| 59 // The owning ExtensionActionViewController. | 59 // The owning ExtensionActionViewController. |
| 60 ExtensionActionViewController* controller_; | 60 ExtensionActionViewController* controller_; |
| 61 | 61 |
| 62 // The extension key binding accelerator this extension action is listening | 62 // The extension key binding accelerator this extension action is listening |
| 63 // for (to show the popup). | 63 // for (to show the popup). |
| 64 scoped_ptr<ui::Accelerator> action_keybinding_; | 64 std::unique_ptr<ui::Accelerator> action_keybinding_; |
| 65 | 65 |
| 66 content::NotificationRegistrar registrar_; | 66 content::NotificationRegistrar registrar_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ExtensionActionPlatformDelegateViews); | 68 DISALLOW_COPY_AND_ASSIGN(ExtensionActionPlatformDelegateViews); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE
_VIEWS_H_ | 71 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE
_VIEWS_H_ |
| OLD | NEW |