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

Unified Diff: chrome/browser/cocoa/extensions/browser_actions_controller.h

Issue 366029: Initial change for the implementation of browser actions on the mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome/app/nibs/Toolbar.xib ('k') | chrome/browser/cocoa/extensions/browser_actions_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/extensions/browser_actions_controller.h
===================================================================
--- chrome/browser/cocoa/extensions/browser_actions_controller.h (revision 0)
+++ chrome/browser/cocoa/extensions/browser_actions_controller.h (revision 0)
@@ -0,0 +1,76 @@
+// Copyright (c) 2009 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_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_
+#define CHROME_BROWSER_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#import "base/scoped_nsobject.h"
+#include "base/scoped_ptr.h"
+
+class Browser;
+@class BrowserActionButton;
+class Extension;
+class ExtensionsServiceObserverBridge;
+class Profile;
+
+extern const CGFloat kBrowserActionButtonPadding;
+extern const CGFloat kBrowserActionWidth;
+
+extern NSString* const kBrowserActionsChangedNotification;
+
+@interface BrowserActionsController : NSObject {
+ @private
+ // Reference to the current browser. Weak.
+ Browser* browser_;
+
+ // The view from Toolbar.xib we'll be rendering our browser actions in. Weak.
+ NSView* containerView_;
+
+ // The current profile. Weak.
+ Profile* profile_;
+
+ // The observer for the ExtensionsService we're getting events from.
+ scoped_ptr<ExtensionsServiceObserverBridge> observer_;
+
+ // A dictionary of Extension ID -> BrowserActionButton pairs representing the
+ // buttons present in the container view. The ID is a string unique to each
+ // extension.
+ scoped_nsobject<NSMutableDictionary> buttons_;
+
+ // The order of the BrowserActionButton objects within the dictionary.
+ scoped_nsobject<NSMutableArray> buttonOrder_;
+}
+
+// Initializes the controller given the current browser and container view that
+// will hold the browser action buttons.
+- (id)initWithBrowser:(Browser*)browser
+ containerView:(NSView*)container;
+
+// Creates and appends any existing browser action buttons present within the
+// extensions service to the toolbar.
+- (void)createButtons;
+
+// Hides the browser action's popup menu (if one is present and visible).
+- (void)hidePopup;
+
+// Marks the container view for redraw. Called by the extension service
+// notification bridge.
+- (void)browserActionVisibilityHasChanged;
+
+// Returns the current number of browser action buttons displayed in the
+// container.
+- (int)buttonCount;
+
+// Executes the action designated by the extension.
+- (void)browserActionClicked:(BrowserActionButton*)sender;
+
+// Returns the current ID of the active tab, -1 in the case where the user is in
+// incognito mode.
+- (int)currentTabId;
+
+@end // @interface BrowserActionsController
+
+#endif // CHROME_BROWSER_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_
Property changes on: chrome/browser/cocoa/extensions/browser_actions_controller.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/app/nibs/Toolbar.xib ('k') | chrome/browser/cocoa/extensions/browser_actions_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698