Home | History | Annotate | Download | only in location_bar
      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_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_
      6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_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 CommandUpdater;
     14 
     15 // Star icon on the right side of the field.
     16 
     17 class StarDecoration : public ImageDecoration {
     18  public:
     19   explicit StarDecoration(CommandUpdater* command_updater);
     20   virtual ~StarDecoration();
     21 
     22   // Sets the image and tooltip based on |starred|.
     23   void SetStarred(bool starred);
     24 
     25   // Get the point where the bookmark bubble should point within the
     26   // decoration's frame.
     27   NSPoint GetBubblePointInFrame(NSRect frame);
     28 
     29   // Implement |LocationBarDecoration|.
     30   virtual bool AcceptsMousePress();
     31   virtual bool OnMousePressed(NSRect frame);
     32   virtual NSString* GetToolTip();
     33 
     34  private:
     35   // For bringing up bookmark bar.
     36   CommandUpdater* command_updater_;  // Weak, owned by Browser.
     37 
     38   // The string to show for a tooltip.
     39   scoped_nsobject<NSString> tooltip_;
     40 
     41   DISALLOW_COPY_AND_ASSIGN(StarDecoration);
     42 };
     43 
     44 #endif  // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_
     45