OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_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/memory/scoped_nsobject.h" | 16 #include "base/memory/scoped_nsobject.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "chrome/browser/sync/sync_ui_util.h" | 18 #include "chrome/browser/sync/sync_ui_util.h" |
19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
21 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 21 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
22 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" | 22 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
23 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 23 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
24 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 24 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
25 #import "chrome/browser/ui/cocoa/themed_window.h" | 25 #import "chrome/browser/ui/cocoa/themed_window.h" |
26 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 26 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
27 #import "chrome/browser/ui/cocoa/view_resizer.h" | 27 #import "chrome/browser/ui/cocoa/view_resizer.h" |
| 28 #include "ui/gfx/rect.h" |
28 | 29 |
29 | 30 |
30 class Browser; | 31 class Browser; |
31 class BrowserWindow; | 32 class BrowserWindow; |
32 class BrowserWindowCocoa; | 33 class BrowserWindowCocoa; |
33 class ConstrainedWindowMac; | 34 class ConstrainedWindowMac; |
34 @class DevToolsController; | 35 @class DevToolsController; |
35 @class DownloadShelfController; | 36 @class DownloadShelfController; |
36 @class FindBarCocoaController; | 37 @class FindBarCocoaController; |
37 @class FullscreenController; | 38 @class FullscreenController; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 + (BrowserWindowController*)browserWindowControllerForView:(NSView*)view; | 141 + (BrowserWindowController*)browserWindowControllerForView:(NSView*)view; |
141 | 142 |
142 // Load the browser window nib and do any Cocoa-specific initialization. | 143 // Load the browser window nib and do any Cocoa-specific initialization. |
143 // Takes ownership of |browser|. | 144 // Takes ownership of |browser|. |
144 - (id)initWithBrowser:(Browser*)browser; | 145 - (id)initWithBrowser:(Browser*)browser; |
145 | 146 |
146 // Call to make the browser go away from other places in the cross-platform | 147 // Call to make the browser go away from other places in the cross-platform |
147 // code. | 148 // code. |
148 - (void)destroyBrowser; | 149 - (void)destroyBrowser; |
149 | 150 |
| 151 // Ensure bounds for the window abide by the minimum window size. |
| 152 - (gfx::Rect)enforceMinWindowSize:(gfx::Rect)bounds; |
| 153 |
150 // Access the C++ bridge between the NSWindow and the rest of Chromium. | 154 // Access the C++ bridge between the NSWindow and the rest of Chromium. |
151 - (BrowserWindow*)browserWindow; | 155 - (BrowserWindow*)browserWindow; |
152 | 156 |
153 // Return a weak pointer to the toolbar controller. | 157 // Return a weak pointer to the toolbar controller. |
154 - (ToolbarController*)toolbarController; | 158 - (ToolbarController*)toolbarController; |
155 | 159 |
156 // Return a weak pointer to the tab strip controller. | 160 // Return a weak pointer to the tab strip controller. |
157 - (TabStripController*)tabStripController; | 161 - (TabStripController*)tabStripController; |
158 | 162 |
159 // Access the ObjC controller that contains the infobars. | 163 // Access the ObjC controller that contains the infobars. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 - (void)resetWindowGrowthState; | 399 - (void)resetWindowGrowthState; |
396 | 400 |
397 // Computes by how far in each direction, horizontal and vertical, the | 401 // Computes by how far in each direction, horizontal and vertical, the |
398 // |source| rect doesn't fit into |target|. | 402 // |source| rect doesn't fit into |target|. |
399 - (NSSize)overflowFrom:(NSRect)source | 403 - (NSSize)overflowFrom:(NSRect)source |
400 to:(NSRect)target; | 404 to:(NSRect)target; |
401 @end // @interface BrowserWindowController(TestingAPI) | 405 @end // @interface BrowserWindowController(TestingAPI) |
402 | 406 |
403 | 407 |
404 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 408 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |