| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <Cocoa/Cocoa.h> | 8 #include <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 @class GrowBoxView; | |
| 11 | |
| 12 class TabContents; | 10 class TabContents; |
| 13 class TabContentsCommandObserver; | 11 class TabContentsCommandObserver; |
| 14 class TabStripModel; | 12 class TabStripModel; |
| 15 | 13 |
| 16 // A class that controls the web contents of a tab. It manages displaying the | 14 // A class that controls the web contents of a tab. It manages displaying the |
| 17 // native view for a given TabContents in |contentsBox_|. | 15 // native view for a given TabContents in |contentsBox_|. |
| 18 | 16 |
| 19 @interface TabContentsController : NSViewController { | 17 @interface TabContentsController : NSViewController { |
| 20 @private | 18 @private |
| 21 TabContentsCommandObserver* observer_; // nil if |commands_| is nil | 19 TabContentsCommandObserver* observer_; // nil if |commands_| is nil |
| 22 TabContents* contents_; // weak | 20 TabContents* contents_; // weak |
| 23 | 21 |
| 24 IBOutlet NSBox* contentsBox_; | 22 IBOutlet NSBox* contentsBox_; |
| 25 IBOutlet GrowBoxView* growBox_; | |
| 26 } | 23 } |
| 27 | 24 |
| 28 // Create the contents of a tab represented by |contents| and loaded from the | 25 // Create the contents of a tab represented by |contents| and loaded from the |
| 29 // nib given by |name|. | 26 // nib given by |name|. |
| 30 - (id)initWithNibName:(NSString*)name | 27 - (id)initWithNibName:(NSString*)name |
| 31 contents:(TabContents*)contents; | 28 contents:(TabContents*)contents; |
| 32 | 29 |
| 33 // Take this view (toolbar and web contents) full screen | 30 // Take this view (toolbar and web contents) full screen |
| 34 - (IBAction)fullScreen:(id)sender; | 31 - (IBAction)fullScreen:(id)sender; |
| 35 | 32 |
| 36 // Called when the tab contents is about to be put into the view hierarchy as | 33 // Called when the tab contents is about to be put into the view hierarchy as |
| 37 // the selected tab. Handles things such as ensuring the toolbar is correctly | 34 // the selected tab. Handles things such as ensuring the toolbar is correctly |
| 38 // enabled. | 35 // enabled. |
| 39 - (void)willBecomeSelectedTab; | 36 - (void)willBecomeSelectedTab; |
| 40 | 37 |
| 41 // Called when the tab contents is updated in some non-descript way (the | 38 // Called when the tab contents is updated in some non-descript way (the |
| 42 // notification from the model isn't specific). |updatedContents| could reflect | 39 // notification from the model isn't specific). |updatedContents| could reflect |
| 43 // an entirely new tab contents object. | 40 // an entirely new tab contents object. |
| 44 - (void)tabDidChange:(TabContents*)updatedContents; | 41 - (void)tabDidChange:(TabContents*)updatedContents; |
| 45 | 42 |
| 46 // Return the rect, in WebKit coordinates (flipped), of the window's grow box | |
| 47 // in the coordinate system of the content area of this tab. | |
| 48 - (NSRect)growBoxRect; | |
| 49 | |
| 50 @end | 43 @end |
| 51 | 44 |
| 52 #endif // CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ | 45 #endif // CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ |
| OLD | NEW |