Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: chrome/browser/cocoa/location_bar/location_icon_decoration.h

Issue 2805070: [Mac] First part of Omnibox decoration refactor. Enable ev bubble. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: comment clarification Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/location_bar/location_icon_decoration.h
diff --git a/chrome/browser/cocoa/location_bar/location_icon_decoration.h b/chrome/browser/cocoa/location_bar/location_icon_decoration.h
new file mode 100644
index 0000000000000000000000000000000000000000..68aaeeee117b43970e1254126d24825756cdf524
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/location_icon_decoration.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_
+#define CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#include "chrome/browser/cocoa/location_bar/location_bar_decoration.h"
+
+class LocationBarViewMac;
+
+// LocationIconDecoration is used to display an icon to the left of
+// the address.
+
+class LocationIconDecoration : public LocationBarDecoration {
+ public:
+ explicit LocationIconDecoration(LocationBarViewMac* owner);
+ virtual ~LocationIconDecoration();
+
+ // The image to display for the location.
+ NSImage* GetImage();
+ void SetImage(NSImage* image);
+
+ // Implement |LocationBarDecoration|.
+ virtual CGFloat GetWidthForSpace(CGFloat width);
+ virtual void DrawInFrame(NSRect frame, NSView* control_view);
+
+ // Allow dragging the current URL.
+ virtual bool IsDraggable();
+ virtual NSPasteboard* GetDragPasteboard();
+ virtual NSImage* GetDragImage() { return GetImage(); }
+
+ // Show the page info panel on click.
+ virtual bool OnMousePressed(NSRect frame);
+
+ private:
+ // The location bar view that owns us.
+ LocationBarViewMac* owner_;
+
+ scoped_nsobject<NSImage> image_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocationIconDecoration);
+};
+
+#endif // CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_ICON_DECORATION_H_

Powered by Google App Engine
This is Rietveld 408576698