| 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 12 matching lines...) Expand all Loading... |
| 23 #import "chrome/browser/ui/cocoa/fullscreen_window.h" | 23 #import "chrome/browser/ui/cocoa/fullscreen_window.h" |
| 24 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 24 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
| 25 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 25 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
| 26 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" | 26 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 27 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" | 27 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
| 28 #import "chrome/browser/ui/cocoa/tabs/side_tab_strip_controller.h" | 28 #import "chrome/browser/ui/cocoa/tabs/side_tab_strip_controller.h" |
| 29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 31 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 31 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 32 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 32 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 33 #include "chrome/common/chrome_switches.h" | |
| 34 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 35 #include "content/browser/renderer_host/render_widget_host_view.h" | 34 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 36 #include "content/browser/tab_contents/tab_contents.h" | 35 #include "content/browser/tab_contents/tab_contents.h" |
| 37 #include "content/browser/tab_contents/tab_contents_view.h" | 36 #include "content/browser/tab_contents/tab_contents_view.h" |
| 38 | 37 |
| 39 // Forward-declare symbols that are part of the 10.6 SDK. | 38 // Forward-declare symbols that are part of the 10.6 SDK. |
| 40 #if !defined(MAC_OS_X_VERSION_10_6) || \ | 39 #if !defined(MAC_OS_X_VERSION_10_6) || \ |
| 41 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | 40 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 |
| 42 | 41 |
| 43 enum { | 42 enum { |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 537 } |
| 539 | 538 |
| 540 - (BOOL)shouldShowBookmarkBar { | 539 - (BOOL)shouldShowBookmarkBar { |
| 541 DCHECK(browser_.get()); | 540 DCHECK(browser_.get()); |
| 542 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? | 541 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
| 543 YES : NO; | 542 YES : NO; |
| 544 } | 543 } |
| 545 | 544 |
| 546 - (BOOL)shouldShowDetachedBookmarkBar { | 545 - (BOOL)shouldShowDetachedBookmarkBar { |
| 547 // NTP4 never detaches the bookmark bar. | 546 // NTP4 never detaches the bookmark bar. |
| 548 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4)) | 547 if (NewTabUI::Ntp4Enabled()) |
| 549 return NO; | 548 return NO; |
| 550 | 549 |
| 551 DCHECK(browser_.get()); | 550 DCHECK(browser_.get()); |
| 552 TabContentsWrapper* tab = browser_->GetSelectedTabContentsWrapper(); | 551 TabContentsWrapper* tab = browser_->GetSelectedTabContentsWrapper(); |
| 553 return (tab && tab->bookmark_tab_helper()->ShouldShowBookmarkBar() && | 552 return (tab && tab->bookmark_tab_helper()->ShouldShowBookmarkBar() && |
| 554 ![previewableContentsController_ isShowingPreview]); | 553 ![previewableContentsController_ isShowingPreview]); |
| 555 } | 554 } |
| 556 | 555 |
| 557 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { | 556 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression { |
| 558 CGFloat newHeight = | 557 CGFloat newHeight = |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 - (void)disableBarVisibilityUpdates { | 869 - (void)disableBarVisibilityUpdates { |
| 871 // Early escape if there's nothing to do. | 870 // Early escape if there's nothing to do. |
| 872 if (!barVisibilityUpdatesEnabled_) | 871 if (!barVisibilityUpdatesEnabled_) |
| 873 return; | 872 return; |
| 874 | 873 |
| 875 barVisibilityUpdatesEnabled_ = NO; | 874 barVisibilityUpdatesEnabled_ = NO; |
| 876 [presentationModeController_ cancelAnimationAndTimers]; | 875 [presentationModeController_ cancelAnimationAndTimers]; |
| 877 } | 876 } |
| 878 | 877 |
| 879 @end // @implementation BrowserWindowController(Private) | 878 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |