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 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 | 1959 |
1960 // Adjust to account for height and possible bookmark bar. Compress by 1 | 1960 // Adjust to account for height and possible bookmark bar. Compress by 1 |
1961 // to account for the separator. | 1961 // to account for the separator. |
1962 anchorRect.origin.y = | 1962 anchorRect.origin.y = |
1963 NSMaxY(anchorRect) - [toolbarController_ desiredHeightForCompression:1]; | 1963 NSMaxY(anchorRect) - [toolbarController_ desiredHeightForCompression:1]; |
1964 | 1964 |
1965 // Shift to window base coordinates. | 1965 // Shift to window base coordinates. |
1966 return [[toolbarView superview] convertRect:anchorRect toView:nil]; | 1966 return [[toolbarView superview] convertRect:anchorRect toView:nil]; |
1967 } | 1967 } |
1968 | 1968 |
1969 - (void)commitInstant { | |
1970 if (BrowserInstantController* controller = browser_->instant_controller()) | |
1971 controller->instant()->CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST); | |
1972 } | |
1973 | |
1974 - (NSRect)instantFrame { | 1969 - (NSRect)instantFrame { |
1975 // The view's bounds are in its own coordinate system. Convert that to the | 1970 // The view's bounds are in its own coordinate system. Convert that to the |
1976 // window base coordinate system, then translate it into the screen's | 1971 // window base coordinate system, then translate it into the screen's |
1977 // coordinate system. | 1972 // coordinate system. |
1978 NSView* view = [overlayableContentsController_ view]; | 1973 NSView* view = [overlayableContentsController_ view]; |
1979 if (!view) | 1974 if (!view) |
1980 return NSZeroRect; | 1975 return NSZeroRect; |
1981 | 1976 |
1982 NSRect frame = [view convertRect:[view bounds] toView:nil]; | 1977 NSRect frame = [view convertRect:[view bounds] toView:nil]; |
1983 NSPoint originInScreenCoords = | 1978 NSPoint originInScreenCoords = |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 | 2261 |
2267 - (BOOL)supportsBookmarkBar { | 2262 - (BOOL)supportsBookmarkBar { |
2268 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2263 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2269 } | 2264 } |
2270 | 2265 |
2271 - (BOOL)isTabbedWindow { | 2266 - (BOOL)isTabbedWindow { |
2272 return browser_->is_type_tabbed(); | 2267 return browser_->is_type_tabbed(); |
2273 } | 2268 } |
2274 | 2269 |
2275 @end // @implementation BrowserWindowController(WindowType) | 2270 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |