| 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_COTNENTS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <Cocoa/Cocoa.h> | 8 #include <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 @class BookmarkView; | 10 @class BookmarkView; |
| 11 @class GrowBoxView; | 11 @class GrowBoxView; |
| 12 @class ToolbarView; | 12 @class ToolbarView; |
| 13 | 13 |
| 14 class BookmarkModel; | 14 class BookmarkModel; |
| 15 class CommandUpdater; | 15 class CommandUpdater; |
| 16 class LocationBar; | 16 class LocationBar; |
| 17 class LocationBarViewMac; | |
| 18 class TabContents; | 17 class TabContents; |
| 19 class TabContentsCommandObserver; | 18 class TabContentsCommandObserver; |
| 20 class TabStripModel; | 19 class TabStripModel; |
| 21 class ToolbarModel; | 20 class ToolbarModel; |
| 22 | 21 |
| 23 // A class that controls the contents of a tab, including the toolbar and | 22 // A class that controls the contents of a tab, including the toolbar and |
| 24 // web area. | 23 // web area. |
| 25 | 24 |
| 26 // TODO(pinkerton): Cole and I went back and forth about whether or not each | 25 // TODO(pinkerton): Cole and I went back and forth about whether or not each |
| 27 // tab should have its own copy of the toolbar. Right now, we decided to leave | 26 // tab should have its own copy of the toolbar. Right now, we decided to leave |
| 28 // it like this as he expects it will make it easier for him to implement | 27 // it like this as he expects it will make it easier for him to implement |
| 29 // tab dragging and tear-off into new windows. It's also not very expensive. | 28 // tab dragging and tear-off into new windows. It's also not very expensive. |
| 30 // As we hook things up, we'll see if this imposes other restrictions (such | 29 // As we hook things up, we'll see if this imposes other restrictions (such |
| 31 // as command-handling or dispatch) that will require us to change the view | 30 // as command-handling or dispatch) that will require us to change the view |
| 32 // layout. | 31 // layout. |
| 33 // TODO(jrg): Following on to pink's comments... each tab does in fact | 32 // TODO(jrg): Following on to pink's comments... each tab does in fact |
| 34 // have its own ToolbarView. Similarly, each also has its own | 33 // have its own ToolbarView. Similarly, each also has its own |
| 35 // BookmarkView. That makes things marginally more expensive. | 34 // BookmarkView. That makes things marginally more expensive. |
| 36 | 35 |
| 37 @interface TabContentsController : NSViewController { | 36 @interface TabContentsController : NSViewController { |
| 38 @private | 37 @private |
| 39 CommandUpdater* commands_; // weak, may be nil | 38 CommandUpdater* commands_; // weak, may be nil |
| 40 TabContentsCommandObserver* observer_; // nil if |commands_| is nil | 39 TabContentsCommandObserver* observer_; // nil if |commands_| is nil |
| 41 LocationBarViewMac* locationBarView_; | 40 LocationBar* locationBarBridge_; |
| 42 TabContents* contents_; // weak | 41 TabContents* contents_; // weak |
| 43 | 42 |
| 44 ToolbarModel* toolbarModel_; // weak, one per window | 43 ToolbarModel* toolbarModel_; // weak, one per window |
| 45 IBOutlet ToolbarView* toolbarView_; | 44 IBOutlet ToolbarView* toolbarView_; |
| 46 | 45 |
| 47 BookmarkModel* bookmarkModel_; // weak; one per window | 46 BookmarkModel* bookmarkModel_; // weak; one per window |
| 48 | 47 |
| 49 // TODO(jrg): write a BookmarkView | 48 // TODO(jrg): write a BookmarkView |
| 50 IBOutlet ToolbarView* /* BookmarkView* */ bookmarkView_; | 49 IBOutlet ToolbarView* /* BookmarkView* */ bookmarkView_; |
| 51 | 50 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 - (void)setStarredState:(BOOL)isStarred; | 96 - (void)setStarredState:(BOOL)isStarred; |
| 98 | 97 |
| 99 // Return the rect, in WebKit coordinates (flipped), of the window's grow box | 98 // Return the rect, in WebKit coordinates (flipped), of the window's grow box |
| 100 // in the coordinate system of the content area of this tab. | 99 // in the coordinate system of the content area of this tab. |
| 101 - (NSRect)growBoxRect; | 100 - (NSRect)growBoxRect; |
| 102 | 101 |
| 103 // Called to update the loading state. Handles updating the go/stop button | 102 // Called to update the loading state. Handles updating the go/stop button |
| 104 // state. | 103 // state. |
| 105 - (void)setIsLoading:(BOOL)isLoading; | 104 - (void)setIsLoading:(BOOL)isLoading; |
| 106 | 105 |
| 107 - (void)defocusLocationBar; | |
| 108 | |
| 109 // Make the location bar the first responder, if possible. | 106 // Make the location bar the first responder, if possible. |
| 110 - (void)focusLocationBar; | 107 - (void)focusLocationBar; |
| 111 | 108 |
| 112 // Change the visibility state of the bookmark bar. | 109 // Change the visibility state of the bookmark bar. |
| 113 - (void)toggleBookmarkBar:(BOOL)enable; | 110 - (void)toggleBookmarkBar:(BOOL)enable; |
| 114 | 111 |
| 115 @end | 112 @end |
| 116 | 113 |
| 117 #endif // CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_ | 114 #endif // CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_ |
| OLD | NEW |