overlayable_contents_controller.mm revision c2db58bd994c04d98e4ee2cd7565b71548655fe3
1// Copyright 2011 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/tab_contents/overlayable_contents_controller.h"
6
7#include "content/public/browser/web_contents.h"
8#include "content/public/browser/web_contents_view.h"
9
10@implementation OverlayableContentsController
11
12- (id)initWithBrowser:(Browser*)browser {
13  if ((self = [super init])) {
14    base::scoped_nsobject<NSView> view(
15        [[NSView alloc] initWithFrame:NSZeroRect]);
16    [view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
17    [self setView:view];
18
19    activeContainer_.reset([[NSView alloc] initWithFrame:NSZeroRect]);
20    [activeContainer_ setAutoresizingMask:NSViewHeightSizable |
21                                          NSViewWidthSizable];
22    [view addSubview:activeContainer_];
23  }
24  return self;
25}
26
27- (NSView*)activeContainer {
28  return activeContainer_.get();
29}
30
31@end
32