| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_ |
| 6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "base/scoped_nsobject.h" |
| 11 #include "chrome/browser/cocoa/location_bar/location_bar_decoration.h" |
| 12 |
| 13 class LocationBarViewMac; |
| 14 |
| 15 // LocationIconDecoration is used to display an icon to the left of |
| 16 // the address. |
| 17 |
| 18 class LocationIconDecoration : public LocationBarDecoration { |
| 19 public: |
| 20 explicit LocationIconDecoration(LocationBarViewMac* owner); |
| 21 virtual ~LocationIconDecoration(); |
| 22 |
| 23 // The image to display for the location. |
| 24 NSImage* GetImage(); |
| 25 void SetImage(NSImage* image); |
| 26 |
| 27 // Implement |LocationBarDecoration|. |
| 28 virtual CGFloat GetWidthForSpace(CGFloat width); |
| 29 virtual void DrawInFrame(NSRect frame, NSView* control_view); |
| 30 |
| 31 // Allow dragging the current URL. |
| 32 virtual bool IsDraggable(); |
| 33 virtual NSPasteboard* GetDragPasteboard(); |
| 34 virtual NSImage* GetDragImage() { return GetImage(); } |
| 35 |
| 36 // Show the page info panel on click. |
| 37 virtual bool OnMousePressed(NSRect frame); |
| 38 |
| 39 private: |
| 40 // The location bar view that owns us. |
| 41 LocationBarViewMac* owner_; |
| 42 |
| 43 scoped_nsobject<NSImage> image_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(LocationIconDecoration); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_ |
| OLD | NEW |