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 "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h" | 10 #include "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // There may be no previewContents_ in the prerender case. | 53 // There may be no previewContents_ in the prerender case. |
54 if (!previewContents_) | 54 if (!previewContents_) |
55 return; | 55 return; |
56 | 56 |
57 // Remove the preview contents. | 57 // Remove the preview contents. |
58 [previewContents_->GetNativeView() removeFromSuperview]; | 58 [previewContents_->GetNativeView() removeFromSuperview]; |
59 previewContents_->WasHidden(); | 59 previewContents_->WasHidden(); |
60 previewContents_ = nil; | 60 previewContents_ = nil; |
61 } | 61 } |
62 | 62 |
63 - (void)onInsertTabWithContents:(WebContents*)contents { | 63 - (void)onActivateTabWithContents:(WebContents*)contents { |
64 if (previewContents_ == contents) { | 64 if (previewContents_ == contents) { |
65 [previewContents_->GetNativeView() removeFromSuperview]; | 65 [previewContents_->GetNativeView() removeFromSuperview]; |
66 previewContents_ = nil; | 66 previewContents_ = nil; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 - (BOOL)isShowingPreview { | 70 - (BOOL)isShowingPreview { |
71 return previewContents_ != nil; | 71 return previewContents_ != nil; |
72 } | 72 } |
73 | 73 |
74 @end | 74 @end |
OLD | NEW |