OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // A class acting as the Objective-C controller for the Browser | 9 // A class acting as the Objective-C controller for the Browser |
10 // object. Handles interactions between Cocoa and the cross-platform | 10 // object. Handles interactions between Cocoa and the cross-platform |
11 // code. Each window has a single toolbar and, by virtue of being a | 11 // code. Each window has a single toolbar and, by virtue of being a |
12 // TabWindowController, a tab strip along the top. | 12 // TabWindowController, a tab strip along the top. |
13 | 13 |
14 #import <Cocoa/Cocoa.h> | 14 #import <Cocoa/Cocoa.h> |
15 | 15 |
16 #include "base/scoped_nsobject.h" | 16 #include "base/scoped_nsobject.h" |
17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
18 #import "chrome/browser/cocoa/bookmarks/bookmark_bar_controller.h" | 18 #import "chrome/browser/cocoa/bookmarks/bookmark_bar_controller.h" |
19 #import "chrome/browser/cocoa/bookmarks/bookmark_bubble_controller.h" | 19 #import "chrome/browser/cocoa/bookmarks/bookmark_bubble_controller.h" |
20 #import "chrome/browser/cocoa/browser_command_executor.h" | 20 #import "chrome/browser/cocoa/browser_command_executor.h" |
| 21 #import "chrome/browser/cocoa/tab_contents_controller.h" |
21 #import "chrome/browser/cocoa/tab_strip_controller.h" | 22 #import "chrome/browser/cocoa/tab_strip_controller.h" |
22 #import "chrome/browser/cocoa/tab_window_controller.h" | 23 #import "chrome/browser/cocoa/tab_window_controller.h" |
23 #import "chrome/browser/cocoa/themed_window.h" | 24 #import "chrome/browser/cocoa/themed_window.h" |
24 #import "chrome/browser/cocoa/url_drop_target.h" | 25 #import "chrome/browser/cocoa/url_drop_target.h" |
25 #import "chrome/browser/cocoa/view_resizer.h" | 26 #import "chrome/browser/cocoa/view_resizer.h" |
26 #include "chrome/browser/sync/sync_ui_util.h" | 27 #include "chrome/browser/sync/sync_ui_util.h" |
27 | 28 |
28 | 29 |
29 class Browser; | 30 class Browser; |
30 class BrowserWindow; | 31 class BrowserWindow; |
(...skipping 14 matching lines...) Expand all Loading... |
45 @class TabStripController; | 46 @class TabStripController; |
46 @class TabStripView; | 47 @class TabStripView; |
47 @class ToolbarController; | 48 @class ToolbarController; |
48 | 49 |
49 | 50 |
50 @interface BrowserWindowController : | 51 @interface BrowserWindowController : |
51 TabWindowController<NSUserInterfaceValidations, | 52 TabWindowController<NSUserInterfaceValidations, |
52 BookmarkBarControllerDelegate, | 53 BookmarkBarControllerDelegate, |
53 BrowserCommandExecutor, | 54 BrowserCommandExecutor, |
54 ViewResizer, | 55 ViewResizer, |
| 56 TabContentsControllerDelegate, |
55 TabStripControllerDelegate> { | 57 TabStripControllerDelegate> { |
56 @private | 58 @private |
57 // The ordering of these members is important as it determines the order in | 59 // The ordering of these members is important as it determines the order in |
58 // which they are destroyed. |browser_| needs to be destroyed last as most of | 60 // which they are destroyed. |browser_| needs to be destroyed last as most of |
59 // the other objects hold weak references to it or things it owns | 61 // the other objects hold weak references to it or things it owns |
60 // (tab/toolbar/bookmark models, profiles, etc). | 62 // (tab/toolbar/bookmark models, profiles, etc). |
61 scoped_ptr<Browser> browser_; | 63 scoped_ptr<Browser> browser_; |
62 NSWindow* savedRegularWindow_; | 64 NSWindow* savedRegularWindow_; |
63 scoped_ptr<BrowserWindowCocoa> windowShim_; | 65 scoped_ptr<BrowserWindowCocoa> windowShim_; |
64 scoped_nsobject<ToolbarController> toolbarController_; | 66 scoped_nsobject<ToolbarController> toolbarController_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // Updates the toolbar (and transitively the location bar) with the states of | 165 // Updates the toolbar (and transitively the location bar) with the states of |
164 // the specified |tab|. If |shouldRestore| is true, we're switching | 166 // the specified |tab|. If |shouldRestore| is true, we're switching |
165 // (back?) to this tab and should restore any previous location bar state | 167 // (back?) to this tab and should restore any previous location bar state |
166 // (such as user editing) as well. | 168 // (such as user editing) as well. |
167 - (void)updateToolbarWithContents:(TabContents*)tab | 169 - (void)updateToolbarWithContents:(TabContents*)tab |
168 shouldRestoreState:(BOOL)shouldRestore; | 170 shouldRestoreState:(BOOL)shouldRestore; |
169 | 171 |
170 // Sets whether or not the current page in the frontmost tab is bookmarked. | 172 // Sets whether or not the current page in the frontmost tab is bookmarked. |
171 - (void)setStarredState:(BOOL)isStarred; | 173 - (void)setStarredState:(BOOL)isStarred; |
172 | 174 |
173 // Return the rect, in WebKit coordinates (flipped), of the window's grow box | |
174 // in the coordinate system of the content area of the currently selected tab. | |
175 - (NSRect)selectedTabGrowBoxRect; | |
176 | |
177 // Called to tell the selected tab to update its loading state. | 175 // Called to tell the selected tab to update its loading state. |
178 // |force| is set if the update is due to changing tabs, as opposed to | 176 // |force| is set if the update is due to changing tabs, as opposed to |
179 // the page-load finishing. See comment in reload_button.h. | 177 // the page-load finishing. See comment in reload_button.h. |
180 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force; | 178 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force; |
181 | 179 |
182 // Brings this controller's window to the front. | 180 // Brings this controller's window to the front. |
183 - (void)activate; | 181 - (void)activate; |
184 | 182 |
185 // Make the location bar the first responder, if possible. | 183 // Make the location bar the first responder, if possible. |
186 - (void)focusLocationBar:(BOOL)selectAll; | 184 - (void)focusLocationBar:(BOOL)selectAll; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 - (void)resetWindowGrowthState; | 386 - (void)resetWindowGrowthState; |
389 | 387 |
390 // Computes by how far in each direction, horizontal and vertical, the | 388 // Computes by how far in each direction, horizontal and vertical, the |
391 // |source| rect doesn't fit into |target|. | 389 // |source| rect doesn't fit into |target|. |
392 - (NSSize)overflowFrom:(NSRect)source | 390 - (NSSize)overflowFrom:(NSRect)source |
393 to:(NSRect)target; | 391 to:(NSRect)target; |
394 @end // @interface BrowserWindowController(TestingAPI) | 392 @end // @interface BrowserWindowController(TestingAPI) |
395 | 393 |
396 | 394 |
397 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 395 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |