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

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: Patch to reland 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
« no previous file with comments | « chrome/browser/ui/panels/panel_window_controller_cocoa.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0576fcc44e54af4f10e9998d34e6f4f19f9a4df6 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,15 @@ enum {
return windowShim_->panel()->draggable();
}
-- (void)startDrag {
+- (void)startDrag:(NSPoint)mouseLocation {
animateOnBoundsChange_ = NO;
- windowShim_->panel()->manager()->StartDragging(windowShim_->panel());
+
+ // Convert from Cocoa's screen coordinates to platform-indepedent screen
+ // coordinates because PanelManager method takes platform-indepedent screen
+ // coordinates.
+ windowShim_->panel()->manager()->StartDragging(
+ windowShim_->panel(),
+ cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation));
}
- (void)endDrag:(BOOL)cancelled {
@@ -418,9 +425,12 @@ enum {
windowShim_->panel()->manager()->EndDragging(cancelled);
}
-- (void)dragWithDeltaX:(int)deltaX
- deltaY:(int)deltaY {
- windowShim_->panel()->manager()->Drag(deltaX, deltaY);
+- (void)drag:(NSPoint)mouseLocation {
+ // Convert from Cocoa's screen coordinates to platform-indepedent screen
+ // coordinates because PanelManager method takes platform-indepedent screen
+ // coordinates.
+ windowShim_->panel()->manager()->Drag(
+ cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation));
}
- (void)setPanelFrame:(NSRect)frame
« no previous file with comments | « chrome/browser/ui/panels/panel_window_controller_cocoa.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698