| 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 #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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 } | 479 } |
| 480 | 480 |
| 481 - (BOOL)shouldShowBookmarkBar { | 481 - (BOOL)shouldShowBookmarkBar { |
| 482 DCHECK(browser_.get()); | 482 DCHECK(browser_.get()); |
| 483 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? | 483 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
| 484 YES : NO; | 484 YES : NO; |
| 485 } | 485 } |
| 486 | 486 |
| 487 - (BOOL)shouldShowDetachedBookmarkBar { | 487 - (BOOL)shouldShowDetachedBookmarkBar { |
| 488 DCHECK(browser_.get()); | 488 DCHECK(browser_.get()); |
| 489 TabContents* tab = chrome::GetActiveTabContents(browser_.get()); | 489 WebContents* web_contents = chrome::GetActiveWebContents(browser_.get()); |
| 490 return (tab && tab->bookmark_tab_helper()->ShouldShowBookmarkBar() && | 490 BookmarkTabHelper* bookmark_tab_helper = |
| 491 web_contents ? BookmarkTabHelper::FromWebContents(web_contents) : NULL; |
| 492 return (bookmark_tab_helper && bookmark_tab_helper->ShouldShowBookmarkBar() && |
| 491 ![previewableContentsController_ isShowingPreview]); | 493 ![previewableContentsController_ isShowingPreview]); |
| 492 } | 494 } |
| 493 | 495 |
| 494 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { | 496 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { |
| 495 CGFloat newHeight = | 497 CGFloat newHeight = |
| 496 [toolbarController_ desiredHeightForCompression:compression]; | 498 [toolbarController_ desiredHeightForCompression:compression]; |
| 497 NSRect toolbarFrame = [[toolbarController_ view] frame]; | 499 NSRect toolbarFrame = [[toolbarController_ view] frame]; |
| 498 CGFloat deltaH = newHeight - toolbarFrame.size.height; | 500 CGFloat deltaH = newHeight - toolbarFrame.size.height; |
| 499 | 501 |
| 500 if (deltaH == 0) | 502 if (deltaH == 0) |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 - (void)disableBarVisibilityUpdates { | 861 - (void)disableBarVisibilityUpdates { |
| 860 // Early escape if there's nothing to do. | 862 // Early escape if there's nothing to do. |
| 861 if (!barVisibilityUpdatesEnabled_) | 863 if (!barVisibilityUpdatesEnabled_) |
| 862 return; | 864 return; |
| 863 | 865 |
| 864 barVisibilityUpdatesEnabled_ = NO; | 866 barVisibilityUpdatesEnabled_ = NO; |
| 865 [presentationModeController_ cancelAnimationAndTimers]; | 867 [presentationModeController_ cancelAnimationAndTimers]; |
| 866 } | 868 } |
| 867 | 869 |
| 868 @end // @implementation BrowserWindowController(Private) | 870 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |