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

Unified Diff: chrome/browser/cocoa/tab_view.mm

Issue 155173: Add context menus to tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_view.mm
===================================================================
--- chrome/browser/cocoa/tab_view.mm (revision 20045)
+++ chrome/browser/cocoa/tab_view.mm (working copy)
@@ -254,7 +254,7 @@
NSPoint origin = sourceWindowFrame_.origin;
origin.x += (thisPoint.x - dragOrigin_.x);
origin.y += (thisPoint.y - dragOrigin_.y);
-
+
if (tearProgress < 1) {
// If the tear animation is not complete, call back to ourself with the
// same event to animate even if the mouse isn't moving.
@@ -262,7 +262,7 @@
[self performSelector:@selector(mouseDragged:)
withObject:theEvent
afterDelay:1.0f/30.0f];
-
+
origin.x = (1 - tearProgress) * tearOrigin_.x + tearProgress * origin.x;
origin.y = (1 - tearProgress) * tearOrigin_.y + tearProgress * origin.y;
}
@@ -355,11 +355,17 @@
[sourceController_ removePlaceholder];
}
-- (void)otherMouseUp:(NSEvent*) theEvent {
+- (void)otherMouseUp:(NSEvent*)theEvent {
// Support middle-click-to-close.
if ([theEvent buttonNumber] == 2) {
[controller_ closeTab:self];
}
}
+// Called when the user hits the right mouse button (or control-clicks) to
+// show a context menu.
+- (void)rightMouseDown:(NSEvent*)theEvent {
+ [NSMenu popUpContextMenu:[self menu] withEvent:theEvent forView:self];
+}
+
@end
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698