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_BUTTON_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ |
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ |
7 | 7 |
8 #import "base/memory/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
9 #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" | 9 #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" |
10 | 10 |
11 // |LocationBarDecoration| which looks and acts like a button. | 11 // |LocationBarDecoration| which looks and acts like a button. |
12 | 12 |
13 class ButtonDecoration : public LocationBarDecoration { | 13 class ButtonDecoration : public LocationBarDecoration { |
14 public: | 14 public: |
15 enum ButtonState { | 15 enum ButtonState { |
16 kButtonStateNormal, | 16 kButtonStateNormal, |
17 kButtonStateHover, | 17 kButtonStateHover, |
18 kButtonStatePressed | 18 kButtonStatePressed |
(...skipping 16 matching lines...) Expand all Loading... |
35 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 35 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
36 virtual ButtonDecoration* AsButtonDecoration() OVERRIDE; | 36 virtual ButtonDecoration* AsButtonDecoration() OVERRIDE; |
37 | 37 |
38 protected: | 38 protected: |
39 // Setters for the images for different states. | 39 // Setters for the images for different states. |
40 void SetNormalImage(NSImage* normal_image); | 40 void SetNormalImage(NSImage* normal_image); |
41 void SetHoverImage(NSImage* hover_image); | 41 void SetHoverImage(NSImage* hover_image); |
42 void SetPressedImage(NSImage* pressed_image); | 42 void SetPressedImage(NSImage* pressed_image); |
43 | 43 |
44 private: | 44 private: |
45 scoped_nsobject<NSImage> normal_image_; | 45 base::scoped_nsobject<NSImage> normal_image_; |
46 scoped_nsobject<NSImage> hover_image_; | 46 base::scoped_nsobject<NSImage> hover_image_; |
47 scoped_nsobject<NSImage> pressed_image_; | 47 base::scoped_nsobject<NSImage> pressed_image_; |
48 ButtonState state_; | 48 ButtonState state_; |
49 | 49 |
50 NSImage* GetImage(); | 50 NSImage* GetImage(); |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(ButtonDecoration); | 52 DISALLOW_COPY_AND_ASSIGN(ButtonDecoration); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ | 55 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ |
OLD | NEW |