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 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // info bar. | 303 // info bar. |
304 return [bookmarkBarController_ isInState:BookmarkBar::DETACHED] || | 304 return [bookmarkBarController_ isInState:BookmarkBar::DETACHED] || |
305 [bookmarkBarController_ isAnimatingToState:BookmarkBar::DETACHED] || | 305 [bookmarkBarController_ isAnimatingToState:BookmarkBar::DETACHED] || |
306 [bookmarkBarController_ isAnimatingFromState:BookmarkBar::DETACHED]; | 306 [bookmarkBarController_ isAnimatingFromState:BookmarkBar::DETACHED]; |
307 } | 307 } |
308 | 308 |
309 - (void)layoutTabContentArea:(NSRect)newFrame { | 309 - (void)layoutTabContentArea:(NSRect)newFrame { |
310 NSView* tabContentView = [self tabContentArea]; | 310 NSView* tabContentView = [self tabContentArea]; |
311 NSRect tabContentFrame = [tabContentView frame]; | 311 NSRect tabContentFrame = [tabContentView frame]; |
312 | 312 |
313 bool contentShifted = | |
314 NSMaxY(tabContentFrame) != NSMaxY(newFrame) || | |
315 NSMinX(tabContentFrame) != NSMinX(newFrame); | |
316 | |
317 tabContentFrame = newFrame; | 313 tabContentFrame = newFrame; |
318 [tabContentView setFrame:tabContentFrame]; | 314 [tabContentView setFrame:tabContentFrame]; |
319 | |
320 // If the relayout shifts the content area up or down, let the renderer know. | |
321 if (contentShifted) { | |
322 WebContents* contents = [self webContents]; | |
323 if (contents) { | |
324 RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView(); | |
325 if (rwhv) | |
326 rwhv->WindowFrameChanged(); | |
327 } | |
328 } | |
329 } | 315 } |
330 | 316 |
331 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { | 317 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { |
332 CGFloat newHeight = | 318 CGFloat newHeight = |
333 [toolbarController_ desiredHeightForCompression:compression]; | 319 [toolbarController_ desiredHeightForCompression:compression]; |
334 NSRect toolbarFrame = [[toolbarController_ view] frame]; | 320 NSRect toolbarFrame = [[toolbarController_ view] frame]; |
335 CGFloat deltaH = newHeight - toolbarFrame.size.height; | 321 CGFloat deltaH = newHeight - toolbarFrame.size.height; |
336 | 322 |
337 if (deltaH == 0) | 323 if (deltaH == 0) |
338 return; | 324 return; |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 return nil; | 1223 return nil; |
1238 } | 1224 } |
1239 | 1225 |
1240 - (BOOL)isFullscreenForTabContent { | 1226 - (BOOL)isFullscreenForTabContent { |
1241 return browser_->exclusive_access_manager() | 1227 return browser_->exclusive_access_manager() |
1242 ->fullscreen_controller() | 1228 ->fullscreen_controller() |
1243 ->IsWindowFullscreenForTabOrPending(); | 1229 ->IsWindowFullscreenForTabOrPending(); |
1244 } | 1230 } |
1245 | 1231 |
1246 @end // @implementation BrowserWindowController(Private) | 1232 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |