summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/wrench_menu_controller.h
blob: 6ec1f554d0e6eb0865a254f43c36da2f12d49180 (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
// Copyright (c) 2010 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_WRENCH_MENU_CONTROLLER_H_
#define CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_

#import <Cocoa/Cocoa.h>

#import "base/cocoa_protocols_mac.h"
#import "chrome/browser/cocoa/menu_controller.h"

@class ToolbarController;
class WrenchMenuModel;

// The Wrench menu has a creative layout, with buttons in menu items. There is
// a cross-platform model for this special menu, but on the Mac it's easier to
// get spacing and alignment precisely right using a NIB. To do that, we
// subclass the generic MenuController implementation and special-case the two
// items that require specific layout and load them from the NIB.
//
// This object is instantiated in Toolbar.xib and is configured by the
// ToolbarController.
@interface WrenchMenuController : MenuController <NSMenuDelegate> {
  IBOutlet NSView* editItem_;
  IBOutlet NSSegmentedControl* editControl_;

  IBOutlet NSView* zoomItem_;
  IBOutlet NSButton* zoomPlus_;
  IBOutlet NSButton* zoomDisplay_;
  IBOutlet NSButton* zoomMinus_;
  IBOutlet NSButton* zoomFullScreen_;
}

// Designated initializer; called within the NIB.
- (id)init;

// Used to dispatch commands from the Wrench menu. The custom items within the
// menu cannot be hooked up directly to First Responder because the window in
// which the controls reside is not the BrowserWindowController, but a
// NSCarbonMenuWindow; this screws up the typical |-commandDispatch:| system.
- (IBAction)dispatchWrenchMenuCommand:(id)sender;

@end

#endif  // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_