| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 // saved user size. (It is possible for the two to coincide.) In this way, the | 720 // saved user size. (It is possible for the two to coincide.) In this way, the |
| 721 // zoom button acts as a toggle. We determine the standard size based on the | 721 // zoom button acts as a toggle. We determine the standard size based on the |
| 722 // content, but enforce a minimum width (calculated using the dimensions of the | 722 // content, but enforce a minimum width (calculated using the dimensions of the |
| 723 // screen) to ensure websites with small intrinsic width (such as google.com) | 723 // screen) to ensure websites with small intrinsic width (such as google.com) |
| 724 // don't end up with a wee window. Moreover, we always declare the standard | 724 // don't end up with a wee window. Moreover, we always declare the standard |
| 725 // width to be at least as big as the current width, i.e., we never want zooming | 725 // width to be at least as big as the current width, i.e., we never want zooming |
| 726 // to the standard width to shrink the window. This is consistent with other | 726 // to the standard width to shrink the window. This is consistent with other |
| 727 // browsers' behaviour, and is desirable in multi-tab situations. Note, however, | 727 // browsers' behaviour, and is desirable in multi-tab situations. Note, however, |
| 728 // that the "toggle" behaviour means that the window can still be "unzoomed" to | 728 // that the "toggle" behaviour means that the window can still be "unzoomed" to |
| 729 // the user size. | 729 // the user size. |
| 730 // Note: this method is also called from -isZoomed. If the returned zoomed rect |
| 731 // equals the current window's frame, -isZoomed returns YES. |
| 730 - (NSRect)windowWillUseStandardFrame:(NSWindow*)window | 732 - (NSRect)windowWillUseStandardFrame:(NSWindow*)window |
| 731 defaultFrame:(NSRect)frame { | 733 defaultFrame:(NSRect)frame { |
| 732 // Forget that we grew the window up (if we in fact did). | 734 // Forget that we grew the window up (if we in fact did). |
| 733 [self resetWindowGrowthState]; | 735 [self resetWindowGrowthState]; |
| 734 | 736 |
| 735 // |frame| already fills the current screen. Never touch y and height since we | 737 // |frame| already fills the current screen. Never touch y and height since we |
| 736 // always want to fill vertically. | 738 // always want to fill vertically. |
| 737 | 739 |
| 738 // If the shift key is down, maximize. Hopefully this should make the | 740 // If the shift key is down, maximize. Hopefully this should make the |
| 739 // "switchers" happy. | 741 // "switchers" happy. |
| (...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2204 | 2206 |
| 2205 - (BOOL)supportsBookmarkBar { | 2207 - (BOOL)supportsBookmarkBar { |
| 2206 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2208 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2207 } | 2209 } |
| 2208 | 2210 |
| 2209 - (BOOL)isTabbedWindow { | 2211 - (BOOL)isTabbedWindow { |
| 2210 return browser_->is_type_tabbed(); | 2212 return browser_->is_type_tabbed(); |
| 2211 } | 2213 } |
| 2212 | 2214 |
| 2213 @end // @implementation BrowserWindowController(WindowType) | 2215 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |