Home | History | Annotate | Download | only in location_bar
      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 #pragma once
      8 
      9 #import <Cocoa/Cocoa.h>
     10 
     11 #include "chrome/browser/ui/cocoa/location_bar/image_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 ImageDecoration {
     19  public:
     20   explicit LocationIconDecoration(LocationBarViewMac* owner);
     21   virtual ~LocationIconDecoration();
     22 
     23   // Allow dragging the current URL.
     24   virtual bool IsDraggable();
     25   virtual NSPasteboard* GetDragPasteboard();
     26   virtual NSImage* GetDragImage();
     27   virtual NSRect GetDragImageFrame(NSRect frame);
     28 
     29   // Get the point where the page info bubble should point within the
     30   // decoration's frame, in the |owner_|'s coordinates.
     31   NSPoint GetBubblePointInFrame(NSRect frame);
     32 
     33   // Show the page info panel on click.
     34   virtual bool OnMousePressed(NSRect frame);
     35   virtual bool AcceptsMousePress();
     36   virtual NSString* GetToolTip();
     37 
     38  private:
     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_
     46