OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ |
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" | 11 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
11 | 12 |
13 class Browser; | |
12 class CommandUpdater; | 14 class CommandUpdater; |
15 class LocationBarViewMac; | |
16 @class MenuController; | |
17 | |
18 namespace ui { | |
19 class SimpleMenuModel; | |
20 } // namespace ui | |
13 | 21 |
14 // Note: this file is under development (see crbug.com/138118). | 22 // Note: this file is under development (see crbug.com/138118). |
15 | 23 |
16 // Plus icon on the right side of the location bar. | 24 // Plus icon on the right side of the location bar. |
17 class PlusDecoration : public ImageDecoration { | 25 class PlusDecoration : public ImageDecoration { |
18 public: | 26 public: |
19 explicit PlusDecoration(CommandUpdater* command_updater); | 27 explicit PlusDecoration(LocationBarViewMac* owner, |
28 CommandUpdater* command_updater, | |
29 Browser* browser); | |
Scott Hess - ex-Googler
2012/07/27 20:31:06
Can drop explicit then.
beaudoin
2012/08/01 02:23:26
Done.
| |
20 virtual ~PlusDecoration(); | 30 virtual ~PlusDecoration(); |
21 | 31 |
22 // Implement |LocationBarDecoration|. | 32 // Implement |LocationBarDecoration|. |
23 virtual bool AcceptsMousePress() OVERRIDE; | 33 virtual bool AcceptsMousePress() OVERRIDE; |
24 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 34 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
25 virtual NSString* GetToolTip() OVERRIDE; | 35 virtual NSString* GetToolTip() OVERRIDE; |
26 | 36 |
27 private: | 37 private: |
38 // Owner of the decoration, used to obtain the menu. | |
39 LocationBarViewMac* owner_; | |
40 | |
28 CommandUpdater* command_updater_; // Weak, owned by Browser. | 41 CommandUpdater* command_updater_; // Weak, owned by Browser. |
29 | 42 |
43 Browser* browser_; | |
44 | |
30 // The string to show for a tooltip. | 45 // The string to show for a tooltip. |
31 scoped_nsobject<NSString> tooltip_; | 46 scoped_nsobject<NSString> tooltip_; |
32 | 47 |
48 // Popup cell. | |
49 scoped_nsobject<NSPopUpButtonCell> popUpCell_; | |
Scott Hess - ex-Googler
2012/07/27 20:31:06
Probably want this one after menuController_ so th
beaudoin
2012/08/01 02:23:26
Done.
| |
50 | |
51 // Model for the menu attached to the plus decoration. | |
52 scoped_ptr<ui::SimpleMenuModel> menu_model_; | |
53 | |
54 // Controller for the menu attached to the plus decoration. | |
55 scoped_nsobject<MenuController> menuController_; | |
56 | |
33 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); | 57 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); |
34 }; | 58 }; |
35 | 59 |
36 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ | 60 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ |
OLD | NEW |