| 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_WEB_INTENTS_BUTTON_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_WEB_INTENTS_BUTTON_DECORATION_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_WEB_INTENTS_BUTTON_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_WEB_INTENTS_BUTTON_DECORATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 WebIntentsButtonDecoration(LocationBarViewMac* owner, NSFont* font); | 25 WebIntentsButtonDecoration(LocationBarViewMac* owner, NSFont* font); |
| 26 virtual ~WebIntentsButtonDecoration(); | 26 virtual ~WebIntentsButtonDecoration(); |
| 27 | 27 |
| 28 // Set the background images to be used for the button. | 28 // Set the background images to be used for the button. |
| 29 void SetButtonImages(NSImage* left, NSImage* center, NSImage* right); | 29 void SetButtonImages(NSImage* left, NSImage* center, NSImage* right); |
| 30 | 30 |
| 31 // LocationBarDecoration | 31 // LocationBarDecoration |
| 32 virtual bool AcceptsMousePress() OVERRIDE; | 32 virtual bool AcceptsMousePress() OVERRIDE; |
| 33 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 33 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| 34 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; | 34 virtual CGFloat GetWidthForSpace(CGFloat width, CGFloat text_width) OVERRIDE; |
| 35 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; | 35 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; |
| 36 | 36 |
| 37 // Optionally display the web intents button. | 37 // Optionally display the web intents button. |
| 38 void Update(content::WebContents* web_contents); | 38 void Update(content::WebContents* web_contents); |
| 39 | 39 |
| 40 // Called from internal animator. | 40 // Called from internal animator. |
| 41 virtual void AnimationTimerFired(); | 41 virtual void AnimationTimerFired(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend class WebIntentsButtonDecorationTest; | 44 friend class WebIntentsButtonDecorationTest; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 CGFloat text_width_; | 56 CGFloat text_width_; |
| 57 scoped_nsobject<NSAttributedString> animated_text_; | 57 scoped_nsobject<NSAttributedString> animated_text_; |
| 58 scoped_nsobject<NSImage> left_image_; | 58 scoped_nsobject<NSImage> left_image_; |
| 59 scoped_nsobject<NSImage> center_image_; | 59 scoped_nsobject<NSImage> center_image_; |
| 60 scoped_nsobject<NSImage> right_image_; | 60 scoped_nsobject<NSImage> right_image_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(WebIntentsButtonDecoration); | 62 DISALLOW_COPY_AND_ASSIGN(WebIntentsButtonDecoration); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_WEB_INTENTS_BUTTON_DECORATION_H_ | 65 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_WEB_INTENTS_BUTTON_DECORATION_H_ |
| OLD | NEW |