| 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 #include "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h" | 5 #include "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/instant/instant_model.h" | 7 #include "chrome/browser/instant/instant_model.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" | 10 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 void InstantPreviewControllerMac::PreviewStateChanged( | 24 void InstantPreviewControllerMac::PreviewStateChanged( |
| 25 const InstantModel& model) { | 25 const InstantModel& model) { |
| 26 if (model.mode().is_ntp() || model.mode().is_search_suggestions()) { | 26 if (model.mode().is_ntp() || model.mode().is_search_suggestions()) { |
| 27 // Drop shadow is only needed if search mode is not |NTP| and preview does | 27 // Drop shadow is only needed if search mode is not |NTP| and preview does |
| 28 // not fill up the entire contents page. | 28 // not fill up the entire contents page. |
| 29 BOOL drawDropShadow = !model.mode().is_ntp() && | 29 BOOL drawDropShadow = !model.mode().is_ntp() && |
| 30 !(model.height() == 100 && | 30 !(model.height() == 100 && |
| 31 model.height_units() == INSTANT_SIZE_PERCENT); | 31 model.height_units() == INSTANT_SIZE_PERCENT); |
| 32 [preview_ showPreview:model.GetPreviewContents() | 32 [preview_ setPreview:model.GetPreviewContents() |
| 33 height:model.height() | 33 height:model.height() |
| 34 heightUnits:model.height_units() | 34 heightUnits:model.height_units() |
| 35 drawDropShadow:drawDropShadow]; | 35 drawDropShadow:drawDropShadow]; |
| 36 } else { | 36 } else { |
| 37 [preview_ hidePreview]; | 37 [preview_ setPreview:NULL |
| 38 height:0 |
| 39 heightUnits:INSTANT_SIZE_PIXELS |
| 40 drawDropShadow:NO]; |
| 38 } | 41 } |
| 39 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode()); | 42 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode()); |
| 40 [window_ updateBookmarkBarStateForInstantPreview]; | 43 [window_ updateBookmarkBarStateForInstantPreview]; |
| 41 } | 44 } |
| OLD | NEW |