| 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 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 return [toolbarController_ customFieldEditorForObject:obj]; | 1950 return [toolbarController_ customFieldEditorForObject:obj]; |
| 1951 } | 1951 } |
| 1952 | 1952 |
| 1953 // (Needed for |BookmarkBarControllerDelegate| protocol.) | 1953 // (Needed for |BookmarkBarControllerDelegate| protocol.) |
| 1954 - (void)bookmarkBar:(BookmarkBarController*)controller | 1954 - (void)bookmarkBar:(BookmarkBarController*)controller |
| 1955 didChangeFromState:(BookmarkBar::State)oldState | 1955 didChangeFromState:(BookmarkBar::State)oldState |
| 1956 toState:(BookmarkBar::State)newState { | 1956 toState:(BookmarkBar::State)newState { |
| 1957 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; | 1957 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; |
| 1958 [self adjustToolbarAndBookmarkBarForCompression: | 1958 [self adjustToolbarAndBookmarkBarForCompression: |
| 1959 [controller getDesiredToolbarHeightCompression]]; | 1959 [controller getDesiredToolbarHeightCompression]]; |
| 1960 |
| 1961 // Stretch the top infobar's arrow if the bookmark has been shown. |
| 1962 NSInteger arrowHeight = [infoBarContainerController_ defaultArrowHeight]; |
| 1963 if (newState == BookmarkBar::SHOW) |
| 1964 arrowHeight += controller.view.frame.size.height; |
| 1965 [infoBarContainerController_ setMaxTopArrowHeight:arrowHeight]; |
| 1960 } | 1966 } |
| 1961 | 1967 |
| 1962 // (Needed for |BookmarkBarControllerDelegate| protocol.) | 1968 // (Needed for |BookmarkBarControllerDelegate| protocol.) |
| 1963 - (void)bookmarkBar:(BookmarkBarController*)controller | 1969 - (void)bookmarkBar:(BookmarkBarController*)controller |
| 1964 willAnimateFromState:(BookmarkBar::State)oldState | 1970 willAnimateFromState:(BookmarkBar::State)oldState |
| 1965 toState:(BookmarkBar::State)newState { | 1971 toState:(BookmarkBar::State)newState { |
| 1966 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; | 1972 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; |
| 1967 [self adjustToolbarAndBookmarkBarForCompression: | 1973 [self adjustToolbarAndBookmarkBarForCompression: |
| 1968 [controller getDesiredToolbarHeightCompression]]; | 1974 [controller getDesiredToolbarHeightCompression]]; |
| 1975 |
| 1976 // Shorten the top infobar's arrow if the bookmark is going to be hidden |
| 1977 // or detached. |
| 1978 NSInteger arrowHeight = [infoBarContainerController_ defaultArrowHeight]; |
| 1979 if (newState != BookmarkBar::SHOW) |
| 1980 [infoBarContainerController_ setMaxTopArrowHeight:arrowHeight]; |
| 1969 } | 1981 } |
| 1970 | 1982 |
| 1971 // (Private/TestingAPI) | 1983 // (Private/TestingAPI) |
| 1972 - (void)resetWindowGrowthState { | 1984 - (void)resetWindowGrowthState { |
| 1973 windowTopGrowth_ = 0; | 1985 windowTopGrowth_ = 0; |
| 1974 windowBottomGrowth_ = 0; | 1986 windowBottomGrowth_ = 0; |
| 1975 isShrinkingFromZoomed_ = NO; | 1987 isShrinkingFromZoomed_ = NO; |
| 1976 } | 1988 } |
| 1977 | 1989 |
| 1978 - (NSSize)overflowFrom:(NSRect)source | 1990 - (NSSize)overflowFrom:(NSRect)source |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2296 | 2308 |
| 2297 - (BOOL)supportsBookmarkBar { | 2309 - (BOOL)supportsBookmarkBar { |
| 2298 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2310 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2299 } | 2311 } |
| 2300 | 2312 |
| 2301 - (BOOL)isTabbedWindow { | 2313 - (BOOL)isTabbedWindow { |
| 2302 return browser_->is_type_tabbed(); | 2314 return browser_->is_type_tabbed(); |
| 2303 } | 2315 } |
| 2304 | 2316 |
| 2305 @end // @implementation BrowserWindowController(WindowType) | 2317 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |