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

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

Issue 2870059: [Mac] Adjust omnibox decoration dragging to keep image under mouse. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Move method per Trung. 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // I-beam cursor. Decorations which do accept mouse events will get 52 // I-beam cursor. Decorations which do accept mouse events will get
53 // an arrow cursor when the mouse is over them. 53 // an arrow cursor when the mouse is over them.
54 virtual bool AcceptsMousePress() { return false; } 54 virtual bool AcceptsMousePress() { return false; }
55 55
56 // Determine if the item can act as a drag source. 56 // Determine if the item can act as a drag source.
57 virtual bool IsDraggable() { return false; } 57 virtual bool IsDraggable() { return false; }
58 58
59 // The image to drag. 59 // The image to drag.
60 virtual NSImage* GetDragImage() { return nil; } 60 virtual NSImage* GetDragImage() { return nil; }
61 61
62 // Return the place within the decoration's frame where the
63 // |GetDragImage()| comes from. This is used to make sure the image
64 // appears correctly under the mouse while dragging. |frame|
65 // matches the frame passed to |DrawInFrame()|.
66 virtual NSRect GetDragImageFrame(NSRect frame) { return NSZeroRect; }
67
62 // The pasteboard to drag. 68 // The pasteboard to drag.
63 virtual NSPasteboard* GetDragPasteboard() { return nil; } 69 virtual NSPasteboard* GetDragPasteboard() { return nil; }
64 70
65 // Called on mouse down. Return |false| to indicate that the press 71 // Called on mouse down. Return |false| to indicate that the press
66 // was not processed and should be handled by the cell. 72 // was not processed and should be handled by the cell.
67 virtual bool OnMousePressed(NSRect frame) { return false; } 73 virtual bool OnMousePressed(NSRect frame) { return false; }
68 74
69 // Called to get the right-click menu, return |nil| for no menu. 75 // Called to get the right-click menu, return |nil| for no menu.
70 virtual NSMenu* GetMenu() { return nil; } 76 virtual NSMenu* GetMenu() { return nil; }
71 77
72 // Width returned by |GetWidthForSpace()| when the item should be 78 // Width returned by |GetWidthForSpace()| when the item should be
73 // omitted for this width; 79 // omitted for this width;
74 static const CGFloat kOmittedWidth; 80 static const CGFloat kOmittedWidth;
75 81
76 private: 82 private:
77 bool visible_; 83 bool visible_;
78 84
79 DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration); 85 DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration);
80 }; 86 };
81 87
82 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_LOCATION_BAR_DECORATION_H_ 88 #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