| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" | |
| 6 | |
| 7 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" | |
| 8 #include "chrome/browser/ui/search/instant_overlay_model.h" | |
| 9 | |
| 10 InstantOverlayControllerMac::InstantOverlayControllerMac( | |
| 11 Browser* browser, | |
| 12 OverlayableContentsController* overlay) | |
| 13 : InstantOverlayController(browser), | |
| 14 overlay_(overlay) { | |
| 15 } | |
| 16 | |
| 17 InstantOverlayControllerMac::~InstantOverlayControllerMac() { | |
| 18 } | |
| 19 | |
| 20 void InstantOverlayControllerMac::OverlayStateChanged( | |
| 21 const InstantOverlayModel& model) { | |
| 22 if (model.mode().is_ntp() || model.mode().is_search_suggestions()) { | |
| 23 // Drop shadow is only needed if search mode is not |NTP| and overlay does | |
| 24 // not fill up the entire contents page. | |
| 25 BOOL drawDropShadow = !model.mode().is_ntp() && | |
| 26 !(model.height() == 100 && | |
| 27 model.height_units() == INSTANT_SIZE_PERCENT); | |
| 28 [overlay_ setOverlay:model.GetOverlayContents() | |
| 29 height:model.height() | |
| 30 heightUnits:model.height_units() | |
| 31 drawDropShadow:drawDropShadow]; | |
| 32 } else if ([overlay_ isShowingOverlay]) { | |
| 33 [overlay_ setOverlay:NULL | |
| 34 height:0 | |
| 35 heightUnits:INSTANT_SIZE_PIXELS | |
| 36 drawDropShadow:NO]; | |
| 37 } | |
| 38 } | |
| OLD | NEW |