summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_contents_controller.h
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 00:57:49 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 00:57:49 +0000
commit44b2c885548d647611d908309dfdf6306eac7ed8 (patch)
treec46fd5199ac07df770ca9b01a0b73dc594b6d63d /chrome/browser/cocoa/tab_contents_controller.h
parent9eef357377e89bffd2d5ff9fad9de0c94d8cc934 (diff)
downloadchromium_src-44b2c885548d647611d908309dfdf6306eac7ed8.zip
chromium_src-44b2c885548d647611d908309dfdf6306eac7ed8.tar.gz
chromium_src-44b2c885548d647611d908309dfdf6306eac7ed8.tar.bz2
Mac bookmark work.
- The bookmark menu is populated dynamically with bookmarks, including subfolders --> submenus. E.g. star something --> shows up in menu. Menu items are disabled but always present and current. - Always Show Bookmarks" menu now live; reads from / writes to preference, and shows correct "toggle state". - Bookmark bar on each tab, present if requested. (Currently an empty box). - Random stuff; e.g. bookmark prefs init moved to a x-plat location. This CL does not contain Cole's views. Bried english description of the nib file changes: - add a new view for the bookmark bar in the tab; hook it up to the controller - Many tag sets (e.g. View-->Always Show Bookmarks Bar now 40009) - Remove dummy bookmark menu items Review URL: http://codereview.chromium.org/46078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_contents_controller.h')
-rw-r--r--chrome/browser/cocoa/tab_contents_controller.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/tab_contents_controller.h b/chrome/browser/cocoa/tab_contents_controller.h
index bc97e4f..3a39b5d 100644
--- a/chrome/browser/cocoa/tab_contents_controller.h
+++ b/chrome/browser/cocoa/tab_contents_controller.h
@@ -7,8 +7,12 @@
#include <Cocoa/Cocoa.h>
-class CommandUpdater;
+@class BookmarkView;
@class GrowBoxView;
+@class ToolbarView;
+
+class BookmarkModel;
+class CommandUpdater;
class LocationBar;
class TabContents;
class TabContentsCommandObserver;
@@ -25,6 +29,9 @@ class ToolbarModel;
// As we hook things up, we'll see if this imposes other restrictions (such
// as command-handling or dispatch) that will require us to change the view
// layout.
+// TODO(jrg): Following on to pink's comments... each tab does in fact
+// have its own ToolbarView. Similarly, each also has its own
+// BookmarkView. That makes things marginally more expensive.
@interface TabContentsController : NSViewController {
@private
@@ -32,7 +39,15 @@ class ToolbarModel;
TabContentsCommandObserver* observer_; // nil if |commands_| is nil
LocationBar* locationBarBridge_;
TabContents* contents_; // weak
+
ToolbarModel* toolbarModel_; // weak, one per window
+ IBOutlet ToolbarView* toolbarView_;
+
+ BookmarkModel* bookmarkModel_; // weak; one per window
+
+ // TODO(jrg): write a BookmarkView
+ IBOutlet ToolbarView* /* BookmarkView* */ bookmarkView_;
+
IBOutlet NSButton* backButton_;
IBOutlet NSButton* forwardButton_;
IBOutlet NSButton* reloadButton_;
@@ -41,6 +56,10 @@ class ToolbarModel;
IBOutlet NSTextField* locationBar_;
IBOutlet NSBox* contentsBox_;
IBOutlet GrowBoxView* growBox_;
+
+ // The contents box will have an offset if shrunk to make room for
+ // the bookmark bar.
+ BOOL contentsBoxHasOffset_;
}
// Create the contents of a tab represented by |contents| and loaded from the
@@ -50,7 +69,8 @@ class ToolbarModel;
bundle:(NSBundle*)bundle
contents:(TabContents*)contents
commands:(CommandUpdater*)commands
- toolbarModel:(ToolbarModel*)toolbarModel;
+ toolbarModel:(ToolbarModel*)toolbarModel
+ bookmarkModel:(BookmarkModel*)bookmarkModel;
// Take this view (toolbar and web contents) full screen
- (IBAction)fullScreen:(id)sender;
@@ -86,6 +106,9 @@ class ToolbarModel;
// Make the location bar the first responder, if possible.
- (void)focusLocationBar;
+// Change the visibility state of the bookmark bar.
+- (void)toggleBookmarkBar:(BOOL)enable;
+
@end
#endif // CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_