OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/tab_contents/overlayable_contents_controller.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 8 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
9 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" | 9 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" |
10 #include "chrome/browser/ui/cocoa/tab_contents/overlay_drop_shadow_view.h" | 10 #include "chrome/browser/ui/cocoa/tab_contents/overlay_drop_shadow_view.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 - (void)setOverlay:(content::WebContents*)overlay | 53 - (void)setOverlay:(content::WebContents*)overlay |
54 height:(CGFloat)height | 54 height:(CGFloat)height |
55 heightUnits:(InstantSizeUnits)heightUnits | 55 heightUnits:(InstantSizeUnits)heightUnits |
56 drawDropShadow:(BOOL)drawDropShadow { | 56 drawDropShadow:(BOOL)drawDropShadow { |
57 // If drawing drop shadow, clip the bottom 1-px-thick separator out of | 57 // If drawing drop shadow, clip the bottom 1-px-thick separator out of |
58 // overlay. | 58 // overlay. |
59 // TODO(sail): remove this when GWS gives chrome the height without the | 59 // TODO(sail): remove this when GWS gives chrome the height without the |
60 // separator. | 60 // separator. |
61 if (drawDropShadow && heightUnits != INSTANT_SIZE_PERCENT) | 61 if (drawDropShadow && heightUnits == INSTANT_SIZE_PIXELS) |
62 --height; | 62 --height; |
63 | 63 |
64 if (overlayContents_ == overlay && | 64 if (overlayContents_ == overlay && |
65 overlayHeight_ == height && | 65 overlayHeight_ == height && |
66 overlayHeightUnits_ == heightUnits && | 66 overlayHeightUnits_ == heightUnits && |
67 drawDropShadow_ == drawDropShadow) { | 67 drawDropShadow_ == drawDropShadow) { |
68 return; | 68 return; |
69 } | 69 } |
70 | 70 |
71 // Remove any old overlay contents before showing the new one. | 71 // Remove any old overlay contents before showing the new one. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 CGFloat height = NSHeight([[self view] bounds]); | 172 CGFloat height = NSHeight([[self view] bounds]); |
173 switch (overlayHeightUnits_) { | 173 switch (overlayHeightUnits_) { |
174 case INSTANT_SIZE_PERCENT: | 174 case INSTANT_SIZE_PERCENT: |
175 return std::min(height, (height * overlayHeight_) / 100); | 175 return std::min(height, (height * overlayHeight_) / 100); |
176 case INSTANT_SIZE_PIXELS: | 176 case INSTANT_SIZE_PIXELS: |
177 return std::min(height, overlayHeight_); | 177 return std::min(height, overlayHeight_); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 @end | 181 @end |
OLD | NEW |