| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SEARCH_BUTTON_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/cocoa/location_bar/button_decoration.h" | 10 #include "chrome/browser/ui/cocoa/location_bar/button_decoration.h" |
| 11 | 11 |
| 12 class LocationBarViewMac; |
| 13 |
| 12 // |SearchButtonDecoration| adds a search/go button to the right of the omnibox. | 14 // |SearchButtonDecoration| adds a search/go button to the right of the omnibox. |
| 13 | 15 |
| 14 class SearchButtonDecoration : public ButtonDecoration { | 16 class SearchButtonDecoration : public ButtonDecoration { |
| 15 public: | 17 public: |
| 16 SearchButtonDecoration(); | 18 explicit SearchButtonDecoration(LocationBarViewMac* owner); |
| 17 virtual ~SearchButtonDecoration(); | 19 virtual ~SearchButtonDecoration(); |
| 18 | 20 |
| 19 // Implement |LocationBarDecoration|. | 21 // Implement |LocationBarDecoration|. |
| 20 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; | 22 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; |
| 21 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; | 23 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; |
| 22 virtual bool OnMousePressed(NSRect frame) OVERRIDE; | 24 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| 23 | 25 |
| 24 private: | 26 private: |
| 27 // The control view that owns this. Weak. |
| 28 LocationBarViewMac* owner_; |
| 29 |
| 25 DISALLOW_COPY_AND_ASSIGN(SearchButtonDecoration); | 30 DISALLOW_COPY_AND_ASSIGN(SearchButtonDecoration); |
| 26 }; | 31 }; |
| 27 | 32 |
| 28 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ | 33 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ |
| OLD | NEW |