#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ORIGIN_CHIP_DECORATION_H_
#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ORIGIN_CHIP_DECORATION_H_
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
#include "chrome/browser/extensions/extension_icon_image.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/browser/ui/cocoa/location_bar/button_decoration.h"
#include "chrome/browser/ui/toolbar/origin_chip_info.h"
class LocationBarViewMac;
namespace content {
class WebContents;
}
class OriginChipDecoration : public ButtonDecoration,
public extensions::IconImage::Observer,
public SafeBrowsingUIManager::Observer {
public:
explicit OriginChipDecoration(LocationBarViewMac* owner);
virtual ~OriginChipDecoration();
void Update();
virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE;
virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE;
virtual NSString* GetToolTip() OVERRIDE;
virtual bool OnMousePressed(NSRect frame) OVERRIDE;
virtual void OnExtensionIconImageChanged(
extensions::IconImage* image) OVERRIDE;
virtual void OnSafeBrowsingHit(
const SafeBrowsingUIManager::UnsafeResource& resource) OVERRIDE;
virtual void OnSafeBrowsingMatch(
const SafeBrowsingUIManager::UnsafeResource& resource) OVERRIDE;
private:
bool ShouldShow() const;
base::scoped_nsobject<NSMutableDictionary> attributes_;
base::scoped_nsobject<NSImage> extension_icon_;
OriginChipInfo info_;
base::scoped_nsobject<NSString> label_;
LocationBarViewMac* owner_;
DISALLOW_COPY_AND_ASSIGN(OriginChipDecoration);
};
#endif