| 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 #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 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 } | 536 } |
| 537 | 537 |
| 538 - (BOOL)shouldShowBookmarkBar { | 538 - (BOOL)shouldShowBookmarkBar { |
| 539 DCHECK(browser_.get()); | 539 DCHECK(browser_.get()); |
| 540 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? | 540 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
| 541 YES : NO; | 541 YES : NO; |
| 542 } | 542 } |
| 543 | 543 |
| 544 - (BOOL)shouldShowDetachedBookmarkBar { | 544 - (BOOL)shouldShowDetachedBookmarkBar { |
| 545 // NTP4 never detaches the bookmark bar. | 545 // NTP4 never detaches the bookmark bar. |
| 546 if (NewTabUI::NTP4Enabled()) | 546 return NO; |
| 547 return NO; | |
| 548 | |
| 549 DCHECK(browser_.get()); | |
| 550 TabContentsWrapper* tab = browser_->GetSelectedTabContentsWrapper(); | |
| 551 return (tab && tab->bookmark_tab_helper()->ShouldShowBookmarkBar() && | |
| 552 ![previewableContentsController_ isShowingPreview]); | |
| 553 } | 547 } |
| 554 | 548 |
| 555 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { | 549 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { |
| 556 CGFloat newHeight = | 550 CGFloat newHeight = |
| 557 [toolbarController_ desiredHeightForCompression:compression]; | 551 [toolbarController_ desiredHeightForCompression:compression]; |
| 558 NSRect toolbarFrame = [[toolbarController_ view] frame]; | 552 NSRect toolbarFrame = [[toolbarController_ view] frame]; |
| 559 CGFloat deltaH = newHeight - toolbarFrame.size.height; | 553 CGFloat deltaH = newHeight - toolbarFrame.size.height; |
| 560 | 554 |
| 561 if (deltaH == 0) | 555 if (deltaH == 0) |
| 562 return; | 556 return; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 - (void)disableBarVisibilityUpdates { | 892 - (void)disableBarVisibilityUpdates { |
| 899 // Early escape if there's nothing to do. | 893 // Early escape if there's nothing to do. |
| 900 if (!barVisibilityUpdatesEnabled_) | 894 if (!barVisibilityUpdatesEnabled_) |
| 901 return; | 895 return; |
| 902 | 896 |
| 903 barVisibilityUpdatesEnabled_ = NO; | 897 barVisibilityUpdatesEnabled_ = NO; |
| 904 [presentationModeController_ cancelAnimationAndTimers]; | 898 [presentationModeController_ cancelAnimationAndTimers]; |
| 905 } | 899 } |
| 906 | 900 |
| 907 @end // @implementation BrowserWindowController(Private) | 901 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |