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

Side by Side Diff: chrome/browser/cocoa/location_bar/location_bar_decoration.h

Issue 2825048: [Mac] Allow omnibox decorations to decline mouse events. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rohit's comment comment, and merge with content-setting change. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_ 5 #ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_
6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_ 6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #import "base/basictypes.h" 10 #import "base/basictypes.h"
(...skipping 28 matching lines...) Expand all
39 // or |kOmittedWidth| if it should be omitted. 39 // or |kOmittedWidth| if it should be omitted.
40 virtual CGFloat GetWidthForSpace(CGFloat width); 40 virtual CGFloat GetWidthForSpace(CGFloat width);
41 41
42 // Draw the decoration in the frame provided. The frame will be 42 // Draw the decoration in the frame provided. The frame will be
43 // generated from an earlier call to |GetWidthForSpace()|. 43 // generated from an earlier call to |GetWidthForSpace()|.
44 virtual void DrawInFrame(NSRect frame, NSView* control_view); 44 virtual void DrawInFrame(NSRect frame, NSView* control_view);
45 45
46 // Returns the tooltip for this decoration, return |nil| for no tooltip. 46 // Returns the tooltip for this decoration, return |nil| for no tooltip.
47 virtual NSString* GetToolTip() { return nil; } 47 virtual NSString* GetToolTip() { return nil; }
48 48
49 // Decorations which do not accept mouse events are treated like the
50 // field's background for purposes of selecting text. When such
51 // decorations are adjacent to the text area, they will show the
52 // I-beam cursor. Decorations which do accept mouse events will get
53 // an arrow cursor when the mouse is over them.
54 virtual bool AcceptsMousePress() { return false; }
55
49 // Determine if the item can act as a drag source. 56 // Determine if the item can act as a drag source.
50 virtual bool IsDraggable() { return false; } 57 virtual bool IsDraggable() { return false; }
51 58
52 // The image to drag. 59 // The image to drag.
53 virtual NSImage* GetDragImage() { return nil; } 60 virtual NSImage* GetDragImage() { return nil; }
54 61
55 // The pasteboard to drag. 62 // The pasteboard to drag.
56 virtual NSPasteboard* GetDragPasteboard() { return nil; } 63 virtual NSPasteboard* GetDragPasteboard() { return nil; }
57 64
58 // Called on mouse down. Return |false| to indicate that the press 65 // Called on mouse down. Return |false| to indicate that the press
59 // was not processed and should be handled by the cell. 66 // was not processed and should be handled by the cell.
60 virtual bool OnMousePressed(NSRect frame) { return false; } 67 virtual bool OnMousePressed(NSRect frame) { return false; }
61 68
62 // Called to get the right-click menu, return |nil| for no menu. 69 // Called to get the right-click menu, return |nil| for no menu.
63 virtual NSMenu* GetMenu() { return nil; } 70 virtual NSMenu* GetMenu() { return nil; }
64 71
65 // Width returned by |GetWidthForSpace()| when the item should be 72 // Width returned by |GetWidthForSpace()| when the item should be
66 // omitted for this width; 73 // omitted for this width;
67 static const CGFloat kOmittedWidth; 74 static const CGFloat kOmittedWidth;
68 75
69 private: 76 private:
70 bool visible_; 77 bool visible_;
71 78
72 DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration); 79 DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration);
73 }; 80 };
74 81
75 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_ 82 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/location_bar/ev_bubble_decoration.h ('k') | chrome/browser/cocoa/location_bar/location_icon_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698