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

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

Issue 6358008: [Mac] Organize some files into chrome/browser/ui/cocoa/tab_contents/.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/ui/cocoa/previewable_contents_controller.h"
6
7 #include "base/logging.h"
8 #include "base/mac/mac_util.h"
9 #include "chrome/browser/tab_contents/tab_contents.h"
10
11 @implementation PreviewableContentsController
12
13 @synthesize activeContainer = activeContainer_;
14
15 - (id)init {
16 if ((self = [super initWithNibName:@"PreviewableContents"
17 bundle:base::mac::MainAppBundle()])) {
18 }
19 return self;
20 }
21
22 - (void)showPreview:(TabContents*)preview {
23 DCHECK(preview);
24
25 // Remove any old preview contents before showing the new one.
26 if (previewContents_)
27 [previewContents_->GetNativeView() removeFromSuperview];
28
29 previewContents_ = preview;
30 NSView* previewView = previewContents_->GetNativeView();
31 [previewView setFrame:[[self view] bounds]];
32
33 // Hide the active container and add the preview contents.
34 [activeContainer_ setHidden:YES];
35 [[self view] addSubview:previewView];
36 }
37
38 - (void)hidePreview {
39 DCHECK(previewContents_);
40
41 // Remove the preview contents and reshow the active container.
42 [previewContents_->GetNativeView() removeFromSuperview];
43 [activeContainer_ setHidden:NO];
44
45 previewContents_ = nil;
46 }
47
48 - (BOOL)isShowingPreview {
49 return previewContents_ != nil;
50 }
51
52 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698