Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.h

Issue 159776: Rewrites the Mac view resizing logic to have the BrowserWindowController... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 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
11 // TabWindowController, a tab strip along the top. 11 // TabWindowController, a tab strip along the top.
12 12
13 #import <Cocoa/Cocoa.h> 13 #import <Cocoa/Cocoa.h>
14 14
15 #include "base/scoped_nsobject.h" 15 #include "base/scoped_nsobject.h"
16 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
17 #import "chrome/browser/cocoa/tab_window_controller.h" 17 #import "chrome/browser/cocoa/tab_window_controller.h"
18 #import "chrome/browser/cocoa/bookmark_bar_controller.h" 18 #import "chrome/browser/cocoa/bookmark_bar_controller.h"
19 #import "chrome/browser/cocoa/view_resizer.h"
19 #import "third_party/GTM/AppKit/GTMTheme.h" 20 #import "third_party/GTM/AppKit/GTMTheme.h"
20 21
21 class Browser; 22 class Browser;
22 class BrowserWindow; 23 class BrowserWindow;
23 class BrowserWindowCocoa; 24 class BrowserWindowCocoa;
24 @class DownloadShelfController; 25 @class DownloadShelfController;
25 @class FindBarCocoaController; 26 @class FindBarCocoaController;
26 @class InfoBarContainerController; 27 @class InfoBarContainerController;
27 class LocationBar; 28 class LocationBar;
28 class StatusBubble; 29 class StatusBubble;
29 class TabContents; 30 class TabContents;
30 @class TabContentsController; 31 @class TabContentsController;
31 @class TabStripController; 32 @class TabStripController;
32 class TabStripModelObserverBridge; 33 class TabStripModelObserverBridge;
33 @class TabStripView; 34 @class TabStripView;
34 @class ToolbarController; 35 @class ToolbarController;
35 @class TitlebarController; 36 @class TitlebarController;
36 37
37 @interface BrowserWindowController : 38 @interface BrowserWindowController :
38 TabWindowController<NSUserInterfaceValidations, 39 TabWindowController<NSUserInterfaceValidations,
39 BookmarkURLOpener, 40 BookmarkURLOpener,
41 ViewResizer,
40 GTMThemeDelegate> { 42 GTMThemeDelegate> {
41 @private 43 @private
42 // The ordering of these members is important as it determines the order in 44 // The ordering of these members is important as it determines the order in
43 // which they are destroyed. |browser_| needs to be destroyed last as most of 45 // which they are destroyed. |browser_| needs to be destroyed last as most of
44 // the other objects hold weak references to it or things it owns 46 // the other objects hold weak references to it or things it owns
45 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the 47 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the
46 // window so that it will live after the NSWindowController dealloc has run 48 // window so that it will live after the NSWindowController dealloc has run
47 // (which happens *before* these scoped pointers are torn down). Keeping it 49 // (which happens *before* these scoped pointers are torn down). Keeping it
48 // alive ensures that weak view or window pointers remain valid through 50 // alive ensures that weak view or window pointers remain valid through
49 // their destruction sequence. 51 // their destruction sequence.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // browser window. Must only be called once per 119 // browser window. Must only be called once per
118 // BrowserWindowController. 120 // BrowserWindowController.
119 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; 121 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController;
120 122
121 // Enters (or exits) fullscreen mode. 123 // Enters (or exits) fullscreen mode.
122 - (void)setFullscreen:(BOOL)fullscreen; 124 - (void)setFullscreen:(BOOL)fullscreen;
123 125
124 // Returns fullscreen state. 126 // Returns fullscreen state.
125 - (BOOL)isFullscreen; 127 - (BOOL)isFullscreen;
126 128
127 // Sent when the infobar view has been resized and other content needs
128 // to be shifted around it.
129 - (void)infoBarResized:(float)newHeight;
130
131 // The user changed the theme. 129 // The user changed the theme.
132 - (void)userChangedTheme; 130 - (void)userChangedTheme;
133 131
134 // Executes the command in the context of the current browser. 132 // Executes the command in the context of the current browser.
135 // |command| is an integer value containing one of the constants defined in the 133 // |command| is an integer value containing one of the constants defined in the
136 // "chrome/app/chrome_dll_resource.h" file. 134 // "chrome/app/chrome_dll_resource.h" file.
137 - (void)executeCommand:(int)command; 135 - (void)executeCommand:(int)command;
138 136
139 // Delegate method for the status bubble to query about its vertical offset. 137 // Delegate method for the status bubble to query about its vertical offset.
140 - (float)verticalOffsetForStatusBubble; 138 - (float)verticalOffsetForStatusBubble;
141 139
142 @end 140 @end
143 141
144 142
145 @interface BrowserWindowController(TestingAPI) 143 @interface BrowserWindowController(TestingAPI)
146 144
147 // Put the incognito badge on the browser and adjust the tab strip 145 // Put the incognito badge on the browser and adjust the tab strip
148 // accordingly. 146 // accordingly.
149 - (void)installIncognitoBadge; 147 - (void)installIncognitoBadge;
150 148
151 // Allows us to initWithBrowser withOUT taking ownership of the browser. 149 // Allows us to initWithBrowser withOUT taking ownership of the browser.
152 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; 150 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt;
153 151
154 // Return an autoreleased NSWindow suitable for fullscreen use. 152 // Return an autoreleased NSWindow suitable for fullscreen use.
155 - (NSWindow*)fullscreenWindow; 153 - (NSWindow*)fullscreenWindow;
156 154
157 @end // BrowserWindowController(TestingAPI) 155 @end // BrowserWindowController(TestingAPI)
158 156
159 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 157 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller_unittest.mm ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698