- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / location_bar / location_icon_decoration.h
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.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
11
12 class LocationBarViewMac;
13
14 // LocationIconDecoration is used to display an icon to the left of
15 // the address.
16
17 class LocationIconDecoration : public ImageDecoration {
18  public:
19   explicit LocationIconDecoration(LocationBarViewMac* owner);
20   virtual ~LocationIconDecoration();
21
22   // Allow dragging the current URL.
23   virtual bool IsDraggable() OVERRIDE;
24   virtual NSPasteboard* GetDragPasteboard() OVERRIDE;
25   virtual NSImage* GetDragImage() OVERRIDE;
26   virtual NSRect GetDragImageFrame(NSRect frame) OVERRIDE;
27
28   // Get the point where the page info bubble should point within the
29   // decoration's frame, in the |owner_|'s coordinates.
30   NSPoint GetBubblePointInFrame(NSRect frame);
31
32   // Show the page info panel on click.
33   virtual bool OnMousePressed(NSRect frame) OVERRIDE;
34   virtual bool AcceptsMousePress() OVERRIDE;
35   virtual NSString* GetToolTip() OVERRIDE;
36
37  private:
38   NSRect drag_frame_;
39   // The location bar view that owns us.
40   LocationBarViewMac* owner_;
41
42   DISALLOW_COPY_AND_ASSIGN(LocationIconDecoration);
43 };
44
45 #endif  // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_