OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
10 // code. Each window has a single toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
(...skipping 14 matching lines...) Expand all Loading... |
25 #import "chrome/browser/ui/cocoa/view_resizer.h" | 25 #import "chrome/browser/ui/cocoa/view_resizer.h" |
26 #include "components/translate/core/common/translate_errors.h" | 26 #include "components/translate/core/common/translate_errors.h" |
27 #include "ui/base/accelerators/accelerator_manager.h" | 27 #include "ui/base/accelerators/accelerator_manager.h" |
28 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
29 | 29 |
30 @class AvatarBaseController; | 30 @class AvatarBaseController; |
31 class BookmarkBubbleObserverCocoa; | 31 class BookmarkBubbleObserverCocoa; |
32 class Browser; | 32 class Browser; |
33 class BrowserWindow; | 33 class BrowserWindow; |
34 class BrowserWindowCocoa; | 34 class BrowserWindowCocoa; |
| 35 @class BrowserWindowCommandHandler; |
35 @class BrowserWindowFullscreenTransition; | 36 @class BrowserWindowFullscreenTransition; |
36 @class DevToolsController; | 37 @class DevToolsController; |
37 @class DownloadShelfController; | 38 @class DownloadShelfController; |
38 class ExtensionKeybindingRegistryCocoa; | 39 class ExtensionKeybindingRegistryCocoa; |
39 @class FindBarCocoaController; | 40 @class FindBarCocoaController; |
40 @class FullscreenModeController; | 41 @class FullscreenModeController; |
41 @class FullscreenWindow; | 42 @class FullscreenWindow; |
42 @class InfoBarContainerController; | 43 @class InfoBarContainerController; |
43 class LocationBarViewMac; | 44 class LocationBarViewMac; |
44 @class OverlayableContentsController; | 45 @class OverlayableContentsController; |
45 class PermissionBubbleCocoa; | 46 class PermissionBubbleCocoa; |
46 @class PresentationModeController; | 47 @class PresentationModeController; |
47 class StatusBubbleMac; | 48 class StatusBubbleMac; |
48 @class TabStripController; | 49 @class TabStripController; |
49 @class TabStripView; | 50 @class TabStripView; |
50 @class ToolbarController; | 51 @class ToolbarController; |
51 @class TranslateBubbleController; | 52 @class TranslateBubbleController; |
52 | 53 |
53 namespace content { | 54 namespace content { |
54 class WebContents; | 55 class WebContents; |
55 } | 56 } |
56 | 57 |
57 namespace extensions { | 58 namespace extensions { |
58 class Command; | 59 class Command; |
59 } | 60 } |
60 | 61 |
61 @interface BrowserWindowController : | 62 @interface BrowserWindowController |
62 TabWindowController<NSUserInterfaceValidations, | 63 : TabWindowController<BookmarkBarControllerDelegate, |
63 BookmarkBarControllerDelegate, | 64 ViewResizer, |
64 ViewResizer, | 65 TabStripControllerDelegate> { |
65 TabStripControllerDelegate> { | |
66 @private | 66 @private |
67 // The ordering of these members is important as it determines the order in | 67 // The ordering of these members is important as it determines the order in |
68 // which they are destroyed. |browser_| needs to be destroyed last as most of | 68 // which they are destroyed. |browser_| needs to be destroyed last as most of |
69 // the other objects hold weak references to it or things it owns | 69 // the other objects hold weak references to it or things it owns |
70 // (tab/toolbar/bookmark models, profiles, etc). | 70 // (tab/toolbar/bookmark models, profiles, etc). |
71 scoped_ptr<Browser> browser_; | 71 scoped_ptr<Browser> browser_; |
72 NSWindow* savedRegularWindow_; | 72 NSWindow* savedRegularWindow_; |
73 scoped_ptr<BrowserWindowCocoa> windowShim_; | 73 scoped_ptr<BrowserWindowCocoa> windowShim_; |
74 base::scoped_nsobject<ToolbarController> toolbarController_; | 74 base::scoped_nsobject<ToolbarController> toolbarController_; |
75 base::scoped_nsobject<TabStripController> tabStripController_; | 75 base::scoped_nsobject<TabStripController> tabStripController_; |
76 base::scoped_nsobject<FindBarCocoaController> findBarCocoaController_; | 76 base::scoped_nsobject<FindBarCocoaController> findBarCocoaController_; |
77 base::scoped_nsobject<InfoBarContainerController> infoBarContainerController_; | 77 base::scoped_nsobject<InfoBarContainerController> infoBarContainerController_; |
78 base::scoped_nsobject<DownloadShelfController> downloadShelfController_; | 78 base::scoped_nsobject<DownloadShelfController> downloadShelfController_; |
79 base::scoped_nsobject<BookmarkBarController> bookmarkBarController_; | 79 base::scoped_nsobject<BookmarkBarController> bookmarkBarController_; |
80 base::scoped_nsobject<DevToolsController> devToolsController_; | 80 base::scoped_nsobject<DevToolsController> devToolsController_; |
81 base::scoped_nsobject<OverlayableContentsController> | 81 base::scoped_nsobject<OverlayableContentsController> |
82 overlayableContentsController_; | 82 overlayableContentsController_; |
83 base::scoped_nsobject<PresentationModeController> presentationModeController_; | 83 base::scoped_nsobject<PresentationModeController> presentationModeController_; |
84 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> | 84 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> |
85 exclusiveAccessBubbleWindowController_; | 85 exclusiveAccessBubbleWindowController_; |
86 base::scoped_nsobject<BrowserWindowFullscreenTransition> | 86 base::scoped_nsobject<BrowserWindowFullscreenTransition> |
87 fullscreenTransition_; | 87 fullscreenTransition_; |
| 88 base::scoped_nsobject<BrowserWindowCommandHandler> commandHandler_; |
88 | 89 |
89 // Strong. StatusBubble is a special case of a strong reference that | 90 // Strong. StatusBubble is a special case of a strong reference that |
90 // we don't wrap in a scoped_ptr because it is acting the same | 91 // we don't wrap in a scoped_ptr because it is acting the same |
91 // as an NSWindowController in that it wraps a window that must | 92 // as an NSWindowController in that it wraps a window that must |
92 // be shut down before our destructors are called. | 93 // be shut down before our destructors are called. |
93 StatusBubbleMac* statusBubble_; | 94 StatusBubbleMac* statusBubble_; |
94 | 95 |
95 scoped_ptr<BookmarkBubbleObserverCocoa> bookmarkBubbleObserver_; | 96 scoped_ptr<BookmarkBubbleObserverCocoa> bookmarkBubbleObserver_; |
96 BookmarkBubbleController* bookmarkBubbleController_; // Weak. | 97 BookmarkBubbleController* bookmarkBubbleController_; // Weak. |
97 BOOL initializing_; // YES while we are currently in initWithBrowser: | 98 BOOL initializing_; // YES while we are currently in initWithBrowser: |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 // IsWindowFullscreenForTabOrPending() returns true. | 493 // IsWindowFullscreenForTabOrPending() returns true. |
493 // -- The corresponding URL will be the url of the web page. | 494 // -- The corresponding URL will be the url of the web page. |
494 | 495 |
495 // Methods having to do with fullscreen and presentation mode. | 496 // Methods having to do with fullscreen and presentation mode. |
496 @interface BrowserWindowController(Fullscreen) | 497 @interface BrowserWindowController(Fullscreen) |
497 | 498 |
498 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter | 499 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter |
499 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. | 500 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. |
500 - (void)handleLionToggleFullscreen; | 501 - (void)handleLionToggleFullscreen; |
501 | 502 |
502 // The title of the fullscreen menu item in the menu bar. | |
503 - (NSString*)titleForFullscreenMenuItem; | |
504 | |
505 // Enters Browser/Appkit Fullscreen. | 503 // Enters Browser/Appkit Fullscreen. |
506 // If |withToolbar| is NO, the tab strip and toolbar are hidden | 504 // If |withToolbar| is NO, the tab strip and toolbar are hidden |
507 // (aka Presentation Mode). | 505 // (aka Presentation Mode). |
508 - (void)enterBrowserFullscreenWithToolbar:(BOOL)withToolbar; | 506 - (void)enterBrowserFullscreenWithToolbar:(BOOL)withToolbar; |
509 | 507 |
510 // Adds or removes the tab strip and toolbar from the current window. The | 508 // Adds or removes the tab strip and toolbar from the current window. The |
511 // window must be in immersive or AppKit Fullscreen. | 509 // window must be in immersive or AppKit Fullscreen. |
512 - (void)updateFullscreenWithToolbar:(BOOL)withToolbar; | 510 - (void)updateFullscreenWithToolbar:(BOOL)withToolbar; |
513 | 511 |
514 // Updates the contents of the fullscreen exit bubble with |url| and | 512 // Updates the contents of the fullscreen exit bubble with |url| and |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 - (ExclusiveAccessBubbleWindowController*)exclusiveAccessBubbleWindowController; | 606 - (ExclusiveAccessBubbleWindowController*)exclusiveAccessBubbleWindowController; |
609 | 607 |
610 // Gets the rect, in window base coordinates, that the omnibox popup should be | 608 // Gets the rect, in window base coordinates, that the omnibox popup should be |
611 // positioned relative to. | 609 // positioned relative to. |
612 - (NSRect)omniboxPopupAnchorRect; | 610 - (NSRect)omniboxPopupAnchorRect; |
613 | 611 |
614 @end // @interface BrowserWindowController (TestingAPI) | 612 @end // @interface BrowserWindowController (TestingAPI) |
615 | 613 |
616 | 614 |
617 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 615 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |