Chromium Code Reviews| Index: chrome/browser/cocoa/tab_contents_controller.h |
| =================================================================== |
| --- chrome/browser/cocoa/tab_contents_controller.h (revision 64775) |
| +++ chrome/browser/cocoa/tab_contents_controller.h (working copy) |
| @@ -8,24 +8,61 @@ |
| #include <Cocoa/Cocoa.h> |
| +#include "base/scoped_ptr.h" |
| + |
| class TabContents; |
| +class TabContentsNotificationBridge; |
| +@class TabContentsViewController; |
| -// A class that controls the web contents of a tab. It manages displaying the |
| +// The interface for the tab contents view controller's delegate. |
| + |
| +@protocol TabContentsViewControllerDelegate |
| + |
| +// Tells the delegate when the tab contents view's frame is about to change. |
| +- (void)tabContentsViewFrameWillChange:(TabContentsViewController*)source |
| + frameRect:(NSRect)frameRect; |
| + |
| +@end |
| + |
| +// A class that controls the TabContents view. It manages displaying the |
| // native view for a given TabContents. |
| // Note that just creating the class does not display the view. We defer |
| // inserting it until the box is the correct size to avoid multiple resize |
| // messages to the renderer. You must call |-ensureContentsVisible| to display |
| // the render widget host view. |
| -@interface TabContentsController : NSViewController { |
| +@interface TabContentsViewController : NSViewController { |
|
rohitrao (ping after 24h)
2010/11/04 23:13:48
Why did you rename this class? We generally don't
Aleksey Shlyapnikov
2010/11/05 00:45:11
There's a class named TabContentsController and it
rohitrao (ping after 24h)
2010/11/12 18:45:19
Do you think there's value in splitting off a base
Aleksey Shlyapnikov
2010/11/13 01:37:11
There's some logic in TabContentsController which
|
| @private |
| TabContents* contents_; // weak |
| + // Delegate to be notified about size changes. |
| + id<TabContentsViewControllerDelegate> delegate_; // weak |
| + scoped_ptr<TabContentsNotificationBridge> tabContentsBridge_; |
| } |
| @property(readonly, nonatomic) TabContents* tabContents; |
| -// Create the contents of a tab represented by |contents|. |
| -- (id)initWithContents:(TabContents*)contents; |
| +- (id)initWithContents:(TabContents*)contents |
| + delegate:(id<TabContentsViewControllerDelegate>)delegate; |
| +// Call when the tab contents is about to be replaced with the currently |
| +// selected tab contents to do not trigger unnecessary content relayout. |
| +- (void)ensureContentsSizeDoesNotChange; |
| + |
| +// Call when the tab view is properly sized and the render widget host view |
| +// should be put into the view hierarchy. |
| +- (void)ensureContentsVisible; |
| + |
| +// Call to change the underlying tab contents object. View is not changed, |
| +// call |-ensureContentsVisible| to display the |newContents|'s render widget |
| +// host view. |
| +- (void)changeTabContents:(TabContents*)newContents; |
| + |
| +@end |
| + |
| +// A class that controls the web contents of a tab. |
| + |
| +@interface TabContentsController : TabContentsViewController { |
| +} |
| + |
| // Called when the tab contents is the currently selected tab and is about to be |
| // removed from the view hierarchy. |
| - (void)willBecomeUnselectedTab; |
| @@ -35,14 +72,6 @@ |
| // enabled. |
| - (void)willBecomeSelectedTab; |
| -// Call when the tab contents is about to be replaced with the currently |
| -// selected tab contents to do not trigger unnecessary content relayout. |
| -- (void)ensureContentsSizeDoesNotChange; |
| - |
| -// Call when the tab view is properly sized and the render widget host view |
| -// should be put into the view hierarchy. |
| -- (void)ensureContentsVisible; |
| - |
| // Called when the tab contents is updated in some non-descript way (the |
| // notification from the model isn't specific). |updatedContents| could reflect |
| // an entirely new tab contents object. |