Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.mm

Issue 11026050: Fix crash when using Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698