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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <Cocoa/Cocoa.h> | 9 #include <Cocoa/Cocoa.h> |
10 | 10 |
11 class TabContents; | 11 class TabContents; |
12 class TabContentsCommandObserver; | 12 class TabContentsCommandObserver; |
13 class TabStripModel; | 13 class TabStripModel; |
14 | 14 |
15 // A class that controls the web contents of a tab. It manages displaying the | 15 // A class that controls the web contents of a tab. It manages displaying the |
16 // native view for a given TabContents and optionally its docked devtools in | 16 // native view for a given TabContents and optionally its docked devtools in |
17 // |contentsContainer_|. | 17 // |contentsContainer_|. |
18 // Note that just creating the class does not display the view in | 18 // Note that just creating the class does not display the view in |
19 // |contentsContainer_|. We defer inserting it until the box is the correct size | 19 // |contentsContainer_|. We defer inserting it until the box is the correct size |
20 // to avoid multiple resize messages to the renderer. You must call | 20 // to avoid multiple resize messages to the renderer. You must call |
21 // |-ensureContentsVisible| to display the render widget host view. | 21 // |-ensureContentsVisible| to display the render widget host view. |
22 | 22 |
23 @interface TabContentsController : NSViewController { | 23 @interface TabContentsController : NSViewController { |
24 @private | 24 @private |
25 TabContentsCommandObserver* observer_; // nil if |commands_| is nil | 25 TabContentsCommandObserver* observer_; // nil if |commands_| is nil |
26 TabContents* contents_; // weak | 26 TabContents* contents_; // weak |
| 27 TabContents* sidebarContents_; // weak |
27 | 28 |
28 IBOutlet NSSplitView* contentsContainer_; | 29 IBOutlet NSSplitView* contentsContainer_; |
| 30 IBOutlet NSSplitView* devToolsContainer_; |
29 } | 31 } |
30 | 32 |
31 // Create the contents of a tab represented by |contents| and loaded from the | 33 // Create the contents of a tab represented by |contents| and loaded from the |
32 // nib given by |name|. | 34 // nib given by |name|. |
33 - (id)initWithNibName:(NSString*)name | 35 - (id)initWithNibName:(NSString*)name |
34 contents:(TabContents*)contents; | 36 contents:(TabContents*)contents; |
35 | 37 |
36 // Called when the tab contents is the currently selected tab and is about to be | 38 // Called when the tab contents is the currently selected tab and is about to be |
37 // removed from the view hierarchy. | 39 // removed from the view hierarchy. |
38 - (void)willBecomeUnselectedTab; | 40 - (void)willBecomeUnselectedTab; |
(...skipping 14 matching lines...) Expand all Loading... |
53 | 55 |
54 // Shows |devToolsContents| in a split view, or removes the bottom view in the | 56 // Shows |devToolsContents| in a split view, or removes the bottom view in the |
55 // split viewif |devToolsContents| is NULL. | 57 // split viewif |devToolsContents| is NULL. |
56 // TODO(thakis): Either move this to tab_window or move infobar handling to here | 58 // TODO(thakis): Either move this to tab_window or move infobar handling to here |
57 // too -- http://crbug.com/31633 . | 59 // too -- http://crbug.com/31633 . |
58 - (void)showDevToolsContents:(TabContents*)devToolsContents; | 60 - (void)showDevToolsContents:(TabContents*)devToolsContents; |
59 | 61 |
60 // Returns the height required by devtools and divider, or 0 if no devtools are | 62 // Returns the height required by devtools and divider, or 0 if no devtools are |
61 // docked to the tab. | 63 // docked to the tab. |
62 - (CGFloat)devToolsHeight; | 64 - (CGFloat)devToolsHeight; |
| 65 |
| 66 // Shows |sidebarContents| in a split view, or removes the right view in the |
| 67 // split view if |sidebarContents| is NULL. |
| 68 // TODO(thakis): Either move this to tab_window or move infobar handling to here |
| 69 // too -- http://crbug.com/31633 . |
| 70 - (void)showSidebarContents:(TabContents*)sidebarContents; |
| 71 |
| 72 // Returns contents of the currently displayed sidebar; returns NULL if there |
| 73 // isn't any. |
| 74 - (TabContents*)sidebarContents; |
| 75 |
63 @end | 76 @end |
64 | 77 |
65 #endif // CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ | 78 #endif // CHROME_BROWSER_COCOA_TAB_CONTENTS_CONTROLLER_H_ |
OLD | NEW |