summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_contents_controller.h
blob: d2cee1f4600d3068132cc80ef5401754ccd03ad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_
#define CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_

#include <Cocoa/Cocoa.h>

class CommandUpdater;
class TabContents;
class TabContentsCommandObserver;
class TabStripModel;

// A class that controls the contents of a tab, including the toolbar and
// web area.

// TODO(pinkerton): Cole and I went back and forth about whether or not each
// tab should have its own copy of the toolbar. Right now, we decided to leave
// it like this as he expects it will make it easier for him to implement
// tab dragging and tear-off into new windows. It's also not very expensive.
// As we hook things up, we'll see if this imposes other restrictions (such
// as command-handling or dispatch) that will require us to change the view
// layout.

@interface TabContentsController : NSViewController {
 @private
  CommandUpdater* commands_;  // weak, may be nil
  TabContentsCommandObserver* observer_;  // nil if |commands_| is nil
  IBOutlet NSButton* backButton_;
  IBOutlet NSButton* forwardButton_;
  IBOutlet NSButton* reloadStopButton_;
  IBOutlet NSButton* starButton_;
  IBOutlet NSTextField* locationBar_;
}

// Create the contents of a tab represented by |contents| and loaded from the
// nib given by |name|. |commands| allows tracking of what's enabled and
// disabled. It may be nil if no updating is desired.
- (id)initWithNibName:(NSString*)name 
               bundle:(NSBundle*)bundle
             contents:(TabContents*)contents
             commands:(CommandUpdater*)commands;

// Take this view (toolbar and web contents) full screen
- (IBAction)fullScreen:(id)sender;

@end

#endif  // CHROME_BROWSER_COCOA_TAB_COTNENTS_CONTROLLER_H_