Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_action_view_controller_cocoa.h

Issue 670463004: Make a platform-independent ToolbarActionViewController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/extension_action_view_controller_cocoa.h
diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_view_controller_cocoa.h b/chrome/browser/ui/cocoa/extensions/extension_action_view_controller_cocoa.h
new file mode 100644
index 0000000000000000000000000000000000000000..25b23d2849f0192ffeb50868580826e418022680
--- /dev/null
+++ b/chrome/browser/ui/cocoa/extensions/extension_action_view_controller_cocoa.h
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_COCOA_H_
+#define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_COCOA_H_
+
+#include "chrome/browser/ui/extensions/extension_action_view_controller.h"
+
+@class ExtensionPopupController;
+class ToolbarActionViewDelegateCocoa;
+
+// The cocoa-specific implementation for ExtensionActionViewController.
+class ExtensionActionViewControllerCocoa
+ : public ExtensionActionViewController {
+ public:
+ ExtensionActionViewControllerCocoa(const extensions::Extension* extension,
+ Browser* browser,
+ ExtensionAction* extension_action);
+ ~ExtensionActionViewControllerCocoa() override;
+
+ private:
+ // ToolbarActionViewController:
+ gfx::NativeView GetPopupNativeView() override;
+ bool IsMenuRunning() const override;
+ void RegisterCommand() override;
+
+ // ExtensionActionViewController:
+ bool IsShowingPopup() const override;
+ void CloseActivePopup() override;
+ void ClosePopupImpl() override;
+ bool ShowPopupWithUrlImpl(PopupShowAction show_action,
+ const GURL& popup_url,
+ bool grant_tab_permissions) override;
+
+ // Returns the popup shown by this extension action, if one exists.
+ ExtensionPopupController* GetPopup() const;
+
+ // Returns the delegate in its cocoa implementation.
+ ToolbarActionViewDelegateCocoa* GetDelegateCocoa();
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionActionViewControllerCocoa);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_COCOA_H_

Powered by Google App Engine
This is Rietveld 408576698