| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STAR_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" | 10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
| 11 | 11 |
| 12 class CommandUpdater; | 12 class CommandUpdater; |
| 13 | 13 |
| 14 // Star icon on the right side of the field. | 14 // Star icon on the right side of the field. |
| 15 | 15 |
| 16 class StarDecoration : public ImageDecoration { | 16 class StarDecoration : public ImageDecoration { |
| 17 public: | 17 public: |
| 18 explicit StarDecoration(CommandUpdater* command_updater); | 18 explicit StarDecoration(CommandUpdater* command_updater); |
| 19 virtual ~StarDecoration(); | 19 virtual ~StarDecoration(); |
| 20 | 20 |
| 21 // Sets the image and tooltip based on |starred|. | 21 // Sets the image and tooltip based on |starred|. |
| 22 void SetStarred(bool starred); | 22 void SetStarred(bool starred); |
| 23 | 23 |
| 24 // Returns true if the star is lit. | 24 // Returns true if the star is lit. |
| 25 bool starred() const { return starred_; } | 25 bool starred() const { return starred_; } |
| 26 | 26 |
| 27 // Implement |LocationBarDecoration|. | 27 // Implement |LocationBarDecoration|. |
| 28 virtual bool AcceptsMousePress() OVERRIDE; | 28 virtual bool AcceptsMousePress() override; |
| 29 virtual bool OnMousePressed(NSRect frame, NSPoint location) OVERRIDE; | 29 virtual bool OnMousePressed(NSRect frame, NSPoint location) override; |
| 30 virtual NSString* GetToolTip() OVERRIDE; | 30 virtual NSString* GetToolTip() override; |
| 31 virtual NSPoint GetBubblePointInFrame(NSRect frame) OVERRIDE; | 31 virtual NSPoint GetBubblePointInFrame(NSRect frame) override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // For bringing up bookmark bar. | 34 // For bringing up bookmark bar. |
| 35 CommandUpdater* command_updater_; // Weak, owned by Browser. | 35 CommandUpdater* command_updater_; // Weak, owned by Browser. |
| 36 | 36 |
| 37 // The string to show for a tooltip. | 37 // The string to show for a tooltip. |
| 38 base::scoped_nsobject<NSString> tooltip_; | 38 base::scoped_nsobject<NSString> tooltip_; |
| 39 | 39 |
| 40 // Whether the star icon is lit. | 40 // Whether the star icon is lit. |
| 41 bool starred_; | 41 bool starred_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(StarDecoration); | 43 DISALLOW_COPY_AND_ASSIGN(StarDecoration); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_ | 46 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_ |
| OLD | NEW |