Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / extensions / extension_action_platform_delegate_cocoa.h
blob0f87210c541fb5dc655c8e2cee83d88fed069320
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_COCOA_H_
8 #import <Foundation/Foundation.h>
10 #include "chrome/browser/ui/extensions/extension_action_platform_delegate.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
14 @class ExtensionPopupController;
16 // The Cocoa-specific implementation for ExtensionActionPlatformDelegate.
17 class ExtensionActionPlatformDelegateCocoa
18 : public ExtensionActionPlatformDelegate,
19 public content::NotificationObserver {
20 public:
21 ExtensionActionPlatformDelegateCocoa(
22 ExtensionActionViewController* controller);
23 ~ExtensionActionPlatformDelegateCocoa() override;
25 private:
26 // ExtensionActionPlatformDelegate:
27 void RegisterCommand() override;
28 void OnDelegateSet() override;
29 void ShowPopup(
30 scoped_ptr<extensions::ExtensionViewHost> host,
31 bool grant_tab_permissions,
32 ExtensionActionViewController::PopupShowAction show_action) override;
33 void CloseOverflowMenu() override;
35 // content::NotificationObserver:
36 void Observe(int type,
37 const content::NotificationSource& source,
38 const content::NotificationDetails& details) override;
40 // Returns the point at which the popup should be shown.
41 NSPoint GetPopupPoint() const;
43 // The main controller for this extension action.
44 ExtensionActionViewController* controller_;
46 content::NotificationRegistrar registrar_;
48 DISALLOW_COPY_AND_ASSIGN(ExtensionActionPlatformDelegateCocoa);
51 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_COCOA_H_