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_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
11 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" | 11 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
12 | 12 |
13 class Browser; | 13 class Browser; |
14 class CommandUpdater; | |
15 class LocationBarViewMac; | 14 class LocationBarViewMac; |
16 | 15 |
17 // Note: this file is under development (see crbug.com/138118). | 16 // Note: this file is under development (see crbug.com/138118). |
18 | 17 |
19 // Plus icon on the right side of the location bar. | 18 // Plus icon on the right side of the location bar. |
20 class PlusDecoration : public ImageDecoration { | 19 class PlusDecoration : public ImageDecoration { |
21 public: | 20 public: |
22 PlusDecoration(LocationBarViewMac* owner, | 21 PlusDecoration(LocationBarViewMac* owner, |
23 CommandUpdater* command_updater, | |
24 Browser* browser); | 22 Browser* browser); |
msw
2012/08/30 00:41:43
nit: fits on line above (or indent to match open p
Cait (Slow)
2012/08/30 01:33:29
Done.
| |
25 virtual ~PlusDecoration(); | 23 virtual ~PlusDecoration(); |
26 | 24 |
27 // Helper to get where the action box menu and bubble point should be | 25 // Helper to get where the action box menu and bubble point should be |
28 // anchored. Similar to |PageActionDecoration| or |StarDecoration|. | 26 // anchored. Similar to |PageActionDecoration| or |StarDecoration|. |
29 NSPoint GetActionBoxAnchorPoint(); | 27 NSPoint GetActionBoxAnchorPoint(); |
30 | 28 |
31 // Implement |LocationBarDecoration|. | 29 // Implement |LocationBarDecoration|. |
32 virtual bool AcceptsMousePress() OVERRIDE; | 30 virtual bool AcceptsMousePress() OVERRIDE; |
33 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 31 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
34 virtual NSString* GetToolTip() OVERRIDE; | 32 virtual NSString* GetToolTip() OVERRIDE; |
35 | 33 |
36 private: | 34 private: |
37 // Owner of the decoration, used to obtain the menu. | 35 // Owner of the decoration, used to obtain the menu. |
38 LocationBarViewMac* owner_; | 36 LocationBarViewMac* owner_; |
39 | 37 |
40 CommandUpdater* command_updater_; // Weak, owned by Browser. | |
41 | |
42 Browser* browser_; | 38 Browser* browser_; |
43 | 39 |
44 // The string to show for a tooltip. | 40 // The string to show for a tooltip. |
45 scoped_nsobject<NSString> tooltip_; | 41 scoped_nsobject<NSString> tooltip_; |
46 | 42 |
47 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); | 43 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); |
48 }; | 44 }; |
49 | 45 |
50 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ | 46 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ |
OLD | NEW |