OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/mac/bundle_locations.h" | 11 #include "base/mac/bundle_locations.h" |
12 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
| 13 #import "base/mac/sdk_forward_declarations.h" |
13 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
15 #include "chrome/app/chrome_command_ids.h" // IDC_* | 16 #include "chrome/app/chrome_command_ids.h" // IDC_* |
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 17 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/devtools/devtools_window.h" | 19 #include "chrome/browser/devtools/devtools_window.h" |
19 #include "chrome/browser/fullscreen.h" | 20 #include "chrome/browser/fullscreen.h" |
20 #include "chrome/browser/profiles/avatar_menu.h" | 21 #include "chrome/browser/profiles/avatar_menu.h" |
21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_info_cache.h" | 23 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 175 |
175 - (NSRect)_growBoxRect; | 176 - (NSRect)_growBoxRect; |
176 | 177 |
177 @end | 178 @end |
178 | 179 |
179 // Replicate specific 10.7 SDK declarations for building with prior SDKs. | 180 // Replicate specific 10.7 SDK declarations for building with prior SDKs. |
180 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 181 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
181 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 182 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
182 | 183 |
183 enum { | 184 enum { |
184 NSWindowAnimationBehaviorDefault = 0, | |
185 NSWindowAnimationBehaviorNone = 2, | |
186 NSWindowAnimationBehaviorDocumentWindow = 3, | |
187 NSWindowAnimationBehaviorUtilityWindow = 4, | |
188 NSWindowAnimationBehaviorAlertPanel = 5 | |
189 }; | |
190 typedef NSInteger NSWindowAnimationBehavior; | |
191 | |
192 enum { | |
193 NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, | 185 NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, |
194 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 | 186 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 |
195 }; | 187 }; |
196 | 188 |
197 enum { | 189 enum { |
198 NSFullScreenWindowMask = 1 << 14 | 190 NSFullScreenWindowMask = 1 << 14 |
199 }; | 191 }; |
200 | 192 |
201 @interface NSWindow (LionSDKDeclarations) | 193 @interface NSWindow (LionSDKDeclarations) |
202 - (void)setRestorable:(BOOL)flag; | 194 - (void)setRestorable:(BOOL)flag; |
203 - (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior; | |
204 @end | 195 @end |
205 | 196 |
206 #endif // MAC_OS_X_VERSION_10_7 | 197 #endif // MAC_OS_X_VERSION_10_7 |
207 | 198 |
208 @implementation BrowserWindowController | 199 @implementation BrowserWindowController |
209 | 200 |
210 + (BrowserWindowController*)browserWindowControllerForWindow:(NSWindow*)window { | 201 + (BrowserWindowController*)browserWindowControllerForWindow:(NSWindow*)window { |
211 while (window) { | 202 while (window) { |
212 id controller = [window windowController]; | 203 id controller = [window windowController]; |
213 if ([controller isKindOfClass:[BrowserWindowController class]]) | 204 if ([controller isKindOfClass:[BrowserWindowController class]]) |
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 | 2228 |
2238 - (BOOL)supportsBookmarkBar { | 2229 - (BOOL)supportsBookmarkBar { |
2239 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2230 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2240 } | 2231 } |
2241 | 2232 |
2242 - (BOOL)isTabbedWindow { | 2233 - (BOOL)isTabbedWindow { |
2243 return browser_->is_type_tabbed(); | 2234 return browser_->is_type_tabbed(); |
2244 } | 2235 } |
2245 | 2236 |
2246 @end // @implementation BrowserWindowController(WindowType) | 2237 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |