| 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 9 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" | 9 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | |
| 11 | 10 |
| 12 InstantPreviewControllerMac::InstantPreviewControllerMac( | 11 InstantPreviewControllerMac::InstantPreviewControllerMac( |
| 13 Browser* browser, | 12 Browser* browser, |
| 14 BrowserWindowController* window, | 13 BrowserWindowController* window, |
| 15 PreviewableContentsController* preview) | 14 PreviewableContentsController* preview) |
| 16 : InstantPreviewController(browser), | 15 : InstantPreviewController(browser), |
| 17 window_(window), | 16 window_(window), |
| 18 preview_(preview) { | 17 preview_(preview) { |
| 19 } | 18 } |
| 20 | 19 |
| 21 InstantPreviewControllerMac::~InstantPreviewControllerMac() { | 20 InstantPreviewControllerMac::~InstantPreviewControllerMac() { |
| 22 } | 21 } |
| 23 | 22 |
| 24 void InstantPreviewControllerMac::PreviewStateChanged( | 23 void InstantPreviewControllerMac::PreviewStateChanged( |
| 25 const InstantModel& model) { | 24 const InstantModel& model) { |
| 26 if (model.mode().is_search_suggestions()) { | 25 if (model.mode().is_search_suggestions()) { |
| 27 // TODO(dhollowa): Needs height and units implementation on Mac. | 26 // TODO(dhollowa): Needs height and units implementation on Mac. |
| 28 [preview_ showPreview:model.GetPreviewContents()->web_contents()]; | 27 [preview_ showPreview:model.GetPreviewContents()]; |
| 29 } else { | 28 } else { |
| 30 [preview_ hidePreview]; | 29 [preview_ hidePreview]; |
| 31 } | 30 } |
| 32 [window_ updateBookmarkBarVisibilityWithAnimation:NO]; | 31 [window_ updateBookmarkBarVisibilityWithAnimation:NO]; |
| 33 } | 32 } |
| OLD | NEW |