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 #include "chrome/browser/instant/instant_model.h" |
| 8 #include "chrome/browser/ui/browser.h" |
| 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
| 11 |
| 12 InstantOverlayControllerMac::InstantOverlayControllerMac( |
| 13 Browser* browser, |
| 14 BrowserWindowController* window, |
| 15 OverlayableContentsController* overlay) |
| 16 : InstantOverlayController(browser), |
| 17 window_(window), |
| 18 overlay_(overlay) { |
| 19 } |
| 20 |
| 21 InstantOverlayControllerMac::~InstantOverlayControllerMac() { |
| 22 } |
| 23 |
| 24 void InstantOverlayControllerMac::OverlayStateChanged( |
| 25 const InstantModel& model) { |
| 26 if (model.overlay()) { |
| 27 // Drop shadow is only needed if the overlay does not fill up the entire |
| 28 // contents page. TODO(sail): Use the computed height, a la the Views code. |
| 29 BOOL drawDropShadow = model.height() != 100 || model.is_height_in_pixels(); |
| 30 [overlay_ setOverlay:model.overlay() |
| 31 height:model.height() |
| 32 isHeightInPixels:model.is_height_in_pixels() |
| 33 drawDropShadow:drawDropShadow]; |
| 34 browser_->MaybeUpdateBookmarkBarStateForInstantOverlay(); |
| 35 } else { |
| 36 [overlay_ setOverlay:NULL |
| 37 height:0 |
| 38 isHeightInPixels:NO |
| 39 drawDropShadow:NO]; |
| 40 } |
| 41 [window_ updateBookmarkBarStateForInstantOverlay]; |
| 42 } |
OLD | NEW |