| 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" |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 968 |
| 969 // Change the height of the view and call |-layoutSubViews|. We set the height | 969 // Change the height of the view and call |-layoutSubViews|. We set the height |
| 970 // here without regard to where the view is on the screen or whether it needs | 970 // here without regard to where the view is on the screen or whether it needs |
| 971 // to "grow up" or "grow down." The below call to |-layoutSubviews| will | 971 // to "grow up" or "grow down." The below call to |-layoutSubviews| will |
| 972 // position each view correctly. | 972 // position each view correctly. |
| 973 NSRect frame = [view frame]; | 973 NSRect frame = [view frame]; |
| 974 if (NSHeight(frame) == height) | 974 if (NSHeight(frame) == height) |
| 975 return; | 975 return; |
| 976 | 976 |
| 977 // Disable screen updates to prevent flickering. | 977 // Disable screen updates to prevent flickering. |
| 978 if (view == [bookmarkBarController_ view] || | 978 gfx::ScopedNSDisableScreenUpdates disabler; |
| 979 view == [downloadShelfController_ view]) { | |
| 980 [[self window] disableScreenUpdatesUntilFlush]; | |
| 981 } | |
| 982 | 979 |
| 983 // Grow or shrink the window by the amount of the height change. We adjust | 980 // Grow or shrink the window by the amount of the height change. We adjust |
| 984 // the window height only in two cases: | 981 // the window height only in two cases: |
| 985 // 1) We are adjusting the height of the bookmark bar and it is currently | 982 // 1) We are adjusting the height of the bookmark bar and it is currently |
| 986 // animating either open or closed. | 983 // animating either open or closed. |
| 987 // 2) We are adjusting the height of the download shelf. | 984 // 2) We are adjusting the height of the download shelf. |
| 988 // | 985 // |
| 989 // We do not adjust the window height for bookmark bar changes on the NTP. | 986 // We do not adjust the window height for bookmark bar changes on the NTP. |
| 990 BOOL shouldAdjustBookmarkHeight = | 987 BOOL shouldAdjustBookmarkHeight = |
| 991 [bookmarkBarController_ isAnimatingBetweenState:BookmarkBar::HIDDEN | 988 [bookmarkBarController_ isAnimatingBetweenState:BookmarkBar::HIDDEN |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 | 2184 |
| 2188 - (BOOL)supportsBookmarkBar { | 2185 - (BOOL)supportsBookmarkBar { |
| 2189 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2186 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2190 } | 2187 } |
| 2191 | 2188 |
| 2192 - (BOOL)isTabbedWindow { | 2189 - (BOOL)isTabbedWindow { |
| 2193 return browser_->is_type_tabbed(); | 2190 return browser_->is_type_tabbed(); |
| 2194 } | 2191 } |
| 2195 | 2192 |
| 2196 @end // @implementation BrowserWindowController(WindowType) | 2193 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |