| 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; |
| 13 | 16 |
| 14 // Note: this file is under development (see crbug.com/138118). | 17 // Note: this file is under development (see crbug.com/138118). |
| 15 | 18 |
| 16 // Plus icon on the right side of the location bar. | 19 // Plus icon on the right side of the location bar. |
| 17 class PlusDecoration : public ImageDecoration { | 20 class PlusDecoration : public ImageDecoration { |
| 18 public: | 21 public: |
| 19 explicit PlusDecoration(CommandUpdater* command_updater); | 22 PlusDecoration(LocationBarViewMac* owner, |
| 23 CommandUpdater* command_updater, |
| 24 Browser* browser); |
| 20 virtual ~PlusDecoration(); | 25 virtual ~PlusDecoration(); |
| 21 | 26 |
| 22 // Implement |LocationBarDecoration|. | 27 // Implement |LocationBarDecoration|. |
| 23 virtual bool AcceptsMousePress() OVERRIDE; | 28 virtual bool AcceptsMousePress() OVERRIDE; |
| 24 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 29 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| 25 virtual NSString* GetToolTip() OVERRIDE; | 30 virtual NSString* GetToolTip() OVERRIDE; |
| 26 | 31 |
| 27 private: | 32 private: |
| 33 // Owner of the decoration, used to obtain the menu. |
| 34 LocationBarViewMac* owner_; |
| 35 |
| 28 CommandUpdater* command_updater_; // Weak, owned by Browser. | 36 CommandUpdater* command_updater_; // Weak, owned by Browser. |
| 29 | 37 |
| 38 Browser* browser_; |
| 39 |
| 30 // The string to show for a tooltip. | 40 // The string to show for a tooltip. |
| 31 scoped_nsobject<NSString> tooltip_; | 41 scoped_nsobject<NSString> tooltip_; |
| 32 | 42 |
| 43 scoped_nsobject<NSPopUpButtonCell> pop_up_cell_; |
| 44 |
| 33 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); | 45 DISALLOW_COPY_AND_ASSIGN(PlusDecoration); |
| 34 }; | 46 }; |
| 35 | 47 |
| 36 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ | 48 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PLUS_DECORATION_H_ |
| OLD | NEW |