| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/previewable_contents_controller.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // There may be no previewContents_ in the prerender case. | 42 // There may be no previewContents_ in the prerender case. |
| 43 if (!previewContents_) | 43 if (!previewContents_) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 // Remove the preview contents. | 46 // Remove the preview contents. |
| 47 [previewContents_->GetNativeView() removeFromSuperview]; | 47 [previewContents_->GetNativeView() removeFromSuperview]; |
| 48 previewContents_->WasHidden(); | 48 previewContents_->WasHidden(); |
| 49 previewContents_ = nil; | 49 previewContents_ = nil; |
| 50 } | 50 } |
| 51 | 51 |
| 52 - (void)onInsertTabWithContents:(WebContents*)contents { |
| 53 if (previewContents_ == contents) { |
| 54 [previewContents_->GetNativeView() removeFromSuperview]; |
| 55 previewContents_ = nil; |
| 56 } |
| 57 } |
| 58 |
| 52 - (BOOL)isShowingPreview { | 59 - (BOOL)isShowingPreview { |
| 53 return previewContents_ != nil; | 60 return previewContents_ != nil; |
| 54 } | 61 } |
| 55 | 62 |
| 56 @end | 63 @end |
| OLD | NEW |