1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 2f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// found in the LICENSE file. 4f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 5f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ 6f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ 7f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#import <Cocoa/Cocoa.h> 9f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 10f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "chrome/browser/ui/cocoa/location_bar/button_decoration.h" 11f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 12f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class LocationBarViewMac; 13f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 14f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// |SearchButtonDecoration| adds a search/go button to the right of the omnibox. 15f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class SearchButtonDecoration : public ButtonDecoration { 17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) public: 18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) explicit SearchButtonDecoration(LocationBarViewMac* owner); 19f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual ~SearchButtonDecoration(); 20f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 21f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // Implement |LocationBarDecoration|. 22f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; 23f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; 24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual bool OnMousePressed(NSRect frame, NSPoint location) OVERRIDE; 25f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 26f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) private: 27f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // The control view that owns this. Weak. 28f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) LocationBarViewMac* owner_; 29f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(SearchButtonDecoration); 31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}; 32f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 33f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SEARCH_BUTTON_DECORATION_H_ 34