Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / location_bar / image_decoration.h
blob0bb4193f987b8ae9590703e7ef23f66dd39a127c
1 // Copyright (c) 2011 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.
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_IMAGE_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_IMAGE_DECORATION_H_
8 #import "base/mac/scoped_nsobject.h"
9 #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
11 // |LocationBarDecoration| which sizes and draws itself according to
12 // an |NSImage|.
14 class ImageDecoration : public LocationBarDecoration {
15 public:
16 ImageDecoration();
17 virtual ~ImageDecoration();
19 NSImage* GetImage();
20 void SetImage(NSImage* image);
22 // Returns the part of |frame| the image is drawn in.
23 NSRect GetDrawRectInFrame(NSRect frame);
25 // Implement |LocationBarDecoration|.
26 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE;
27 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE;
29 private:
30 base::scoped_nsobject<NSImage> image_;
32 DISALLOW_COPY_AND_ASSIGN(ImageDecoration);
35 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_IMAGE_DECORATION_H_