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

Unified Diff: chrome/browser/cocoa/extension_shelf_controller.h

Issue 175025: Add a bare-bones extension shelf that displays extension items on OS X. (Closed)
Patch Set: Merge ToT, address more comments Created 11 years, 3 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/cocoa/extension_shelf_controller.h
diff --git a/chrome/browser/cocoa/extension_shelf_controller.h b/chrome/browser/cocoa/extension_shelf_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..a533c7a2536170ec8f42139b340d5cf16cd875d1
--- /dev/null
+++ b/chrome/browser/cocoa/extension_shelf_controller.h
@@ -0,0 +1,49 @@
+// 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.
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_ptr.h"
+#import "chrome/browser/cocoa/view_resizer.h"
+
+class Browser;
+class ExtensionShelfMac;
+
+// A controller for the extension shelf. After creating on object of this class,
+// insert its |view| into a superview and call |wasInsertedIntoWindow|. After
+// that, the controller automatically registers itself in the extensions
+// subsystem and manages displaying toolstrips in the extension shelf.
+@interface ExtensionShelfController : NSViewController {
+ @private
+ CGFloat shelfHeight_;
+
+ scoped_ptr<ExtensionShelfMac> bridge_;
+
+ // Delegate that handles resizing our view.
+ id<ViewResizer> resizeDelegate_;
+
+ Browser* browser_;
+}
+
+// Initializes a new ExtensionShelfController.
+- (id)initWithBrowser:(Browser*)browser
+ resizeDelegate:(id<ViewResizer>)resizeDelegate;
+
+// Makes the extension shelf view managed by this class visible.
+- (IBAction)show:(id)sender;
+
+// Makes the extension shelf view managed by this class invisible.
+- (IBAction)hide:(id)sender;
+
+// Returns the height this shelf has when it's visible (which is different from
+// the frame's height if the shelf is hidden).
+- (CGFloat)height;
+
+// Call this once this shelf's view has been inserted into a superview. It will
+// create the internal bridge object to chrome's extension system and call
+// cacheDisplayInRect:toBitmapImageRep: on the |view|, which requires that it is
+// in a superview.
+- (void)wasInsertedIntoWindow;
+
+@end
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/extension_shelf_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698