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

Unified Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 9616037: Change panel drag related methods to use mouse location in screen coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac trybot Created 8 years, 9 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/ui/panels/panel_window_controller_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
index 97f05e339422a55d03b1bd7ca2f473e21867d7a5..322cee3ad20854ad63f3dba26faf44e751310cff 100644
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
@@ -32,6 +32,7 @@
#include "chrome/browser/ui/panels/panel_settings_menu_model.h"
#include "chrome/browser/ui/panels/panel_strip.h"
#import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h"
+#import "chrome/browser/ui/panels/panel_utils_cocoa.h"
#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
@@ -408,9 +409,11 @@ enum {
return windowShim_->panel()->draggable();
}
-- (void)startDrag {
+- (void)startDrag:(NSPoint)mouseLocation {
animateOnBoundsChange_ = NO;
- windowShim_->panel()->manager()->StartDragging(windowShim_->panel());
+ windowShim_->panel()->manager()->StartDragging(
+ windowShim_->panel(),
+ cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation));
jennb 2012/03/07 00:17:46 The .h said mouseLocation was already in screen co
jianli 2012/03/07 00:46:49 Added comment.
}
- (void)endDrag:(BOOL)cancelled {
@@ -418,9 +421,9 @@ enum {
windowShim_->panel()->manager()->EndDragging(cancelled);
}
-- (void)dragWithDeltaX:(int)deltaX
- deltaY:(int)deltaY {
- windowShim_->panel()->manager()->Drag(deltaX, deltaY);
+- (void)drag:(NSPoint)mouseLocation {
+ windowShim_->panel()->manager()->Drag(
+ cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation));
}
- (void)setPanelFrame:(NSRect)frame

Powered by Google App Engine
This is Rietveld 408576698