summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_controller.h
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 16:35:23 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 16:35:23 +0000
commit30beb604b883f9219aa33c426871023fe4b52209 (patch)
tree84b5bede0a19e9f4db035f4a2663a6269acd32bc /chrome/browser/cocoa/tab_controller.h
parent8485f17afe566edb0cbe46ec30d5bc0c117619a4 (diff)
downloadchromium_src-30beb604b883f9219aa33c426871023fe4b52209.zip
chromium_src-30beb604b883f9219aa33c426871023fe4b52209.tar.gz
chromium_src-30beb604b883f9219aa33c426871023fe4b52209.tar.bz2
Add a TabController class to manage a TabView (with corresponding xib). Rewrite strip controller to create and manage TabControllers instead of NSButtons.
Review URL: http://codereview.chromium.org/43137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_controller.h')
-rw-r--r--chrome/browser/cocoa/tab_controller.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_controller.h b/chrome/browser/cocoa/tab_controller.h
new file mode 100644
index 0000000..0760ccd
--- /dev/null
+++ b/chrome/browser/cocoa/tab_controller.h
@@ -0,0 +1,44 @@
+// 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_TAB_CONTROLLER_H_
+#define CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+@class TabView;
+
+// A class that manages a single tab in the tab strip. Set its target/action
+// to be sent a message when the tab is selected by the user clicking. Setting
+// the |loading| property to YES visually indicates that this tab is currently
+// loading content via a spinner.
+
+@interface TabController : NSViewController {
+ @private
+ IBOutlet NSButton *backgroundButton_;
+ IBOutlet NSButton *closeButton_;
+ IBOutlet NSProgressIndicator *progressIndicator_;
+ BOOL selected_;
+ BOOL loading_;
+ NSImage *image_;
+ id target_; // weak, where actions are sent, eg selectTab:
+ SEL action_; // selector sent when tab is seleted by clicking
+}
+
+@property(retain, nonatomic) NSImage *image;
+@property(assign, nonatomic) BOOL selected;
+@property(assign, nonatomic) BOOL loading;
+@property(assign, nonatomic) id target;
+@property(assign, nonatomic) SEL action;
+
+// Minimum and maximum allowable tab width.
++ (float)minTabWidth;
++ (float)maxTabWidth;
+
+// The view associated with this controller, pre-casted as a TabView
+- (TabView *)tabView;
+
+@end
+
+#endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_