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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.h

Issue 11103042: New custom styling for action box menu on Os X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Answered shess final round of comments. 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
(Empty)
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ACTION_BOX_MENU_BUBBLE_CONTROLLER_H _
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ACTION_BOX_MENU_BUBBLE_CONTROLLER_H _
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/memory/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
13 #import "chrome/browser/ui/cocoa/tracking_area.h"
14
15 class Browser;
16 @class HoverImageButton;
17
18 namespace ui {
19 class MenuModel;
20 }
21
22 // This window controller manages the action box popup menu.
23 @interface ActionBoxMenuBubbleController : BaseBubbleController {
24 @private
25 // The model that contains the data from the backend.
26 scoped_ptr<ui::MenuModel> model_;
27
28 // Array of the below view controllers.
29 scoped_nsobject<NSMutableArray> items_;
30 }
31
32 // Designated initializer. |point| must be in screen coordinates.
33 - (id)initWithModel:(scoped_ptr<ui::MenuModel>)model
34 parentWindow:(NSWindow*)parent
35 anchoredAt:(NSPoint)point;
36
37 // Accesses the model.
38 - (ui::MenuModel*)model;
39
40 // Executes the action of a given menu item.
41 - (IBAction)itemSelected:(id)sender;
42
43 @end
44
45 ////////////////////////////////////////////////////////////////////////////////
46
47 // This view controller manages the menu item XIB.
48 @interface ActionBoxMenuItemController : NSViewController {
49 @private
50 // The parent menu controller owns this.
51 __weak ActionBoxMenuBubbleController* controller_;
52
53 size_t modelIndex_;
54
55 // Tracks whether this item is currently highlighted.
56 BOOL isHighlighted_;
57
58 // Instance variables that back the outlets.
59 IBOutlet __weak NSImageView* iconView_;
60 IBOutlet __weak NSTextField* nameField_;
61 }
62 @property(readonly, nonatomic) size_t modelIndex;
63 @property(assign, nonatomic) BOOL isHighlighted;
64 @property(assign, nonatomic) NSTextField* nameField;
65
66 // Designated initializer.
67 - (id)initWithModelIndex:(size_t)modelIndex
68 menuController:(ActionBoxMenuBubbleController*)controller;
69
70 // Highlights the subviews appropriately for a given event.
71 - (void)highlightForEvent:(NSEvent*)event;
72
73 // Execute the action of a given menu item.
74 - (IBAction)itemSelected:(id)sender;
75
76 @end
77
78 ////////////////////////////////////////////////////////////////////////////////
79
80 // Simple button cell to get tracking and mouse events forwarded back to the
81 // view controller for changing highlight style of the item subviews. This is
82 // an invisible button that underlays most of the menu item and is responsible
83 // for performing the attached action.
84 @interface ActionBoxMenuItemView : NSView {
85 @private
86 // The controller that manages this.
87 IBOutlet __weak ActionBoxMenuItemController* viewController_;
88
89 // Used to highlight the background on hover.
90 ScopedCrTrackingArea trackingArea_;
91 }
92
93 @property(assign, nonatomic) ActionBoxMenuItemController* viewController;
94
95 @end
96
97 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ACTION_BOX_MENU_BUBBLE_CONTROLLE R_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/info_bubble_view.mm ('k') | chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698