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 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 | 1948 |
1949 // Adjust to account for height and possible bookmark bar. Compress by 1 | 1949 // Adjust to account for height and possible bookmark bar. Compress by 1 |
1950 // to account for the separator. | 1950 // to account for the separator. |
1951 anchorRect.origin.y = | 1951 anchorRect.origin.y = |
1952 NSMaxY(anchorRect) - [toolbarController_ desiredHeightForCompression:1]; | 1952 NSMaxY(anchorRect) - [toolbarController_ desiredHeightForCompression:1]; |
1953 | 1953 |
1954 // Shift to window base coordinates. | 1954 // Shift to window base coordinates. |
1955 return [[toolbarView superview] convertRect:anchorRect toView:nil]; | 1955 return [[toolbarView superview] convertRect:anchorRect toView:nil]; |
1956 } | 1956 } |
1957 | 1957 |
1958 - (void)commitInstant { | |
1959 if (BrowserInstantController* controller = browser_->instant_controller()) | |
1960 controller->instant()->CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST); | |
1961 } | |
1962 | |
1963 - (NSRect)instantFrame { | 1958 - (NSRect)instantFrame { |
1964 // The view's bounds are in its own coordinate system. Convert that to the | 1959 // The view's bounds are in its own coordinate system. Convert that to the |
1965 // window base coordinate system, then translate it into the screen's | 1960 // window base coordinate system, then translate it into the screen's |
1966 // coordinate system. | 1961 // coordinate system. |
1967 NSView* view = [overlayableContentsController_ view]; | 1962 NSView* view = [overlayableContentsController_ view]; |
1968 if (!view) | 1963 if (!view) |
1969 return NSZeroRect; | 1964 return NSZeroRect; |
1970 | 1965 |
1971 NSRect frame = [view convertRect:[view bounds] toView:nil]; | 1966 NSRect frame = [view convertRect:[view bounds] toView:nil]; |
1972 NSPoint originInScreenCoords = | 1967 NSPoint originInScreenCoords = |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2255 | 2250 |
2256 - (BOOL)supportsBookmarkBar { | 2251 - (BOOL)supportsBookmarkBar { |
2257 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2252 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2258 } | 2253 } |
2259 | 2254 |
2260 - (BOOL)isTabbedWindow { | 2255 - (BOOL)isTabbedWindow { |
2261 return browser_->is_type_tabbed(); | 2256 return browser_->is_type_tabbed(); |
2262 } | 2257 } |
2263 | 2258 |
2264 @end // @implementation BrowserWindowController(WindowType) | 2259 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |