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

Unified Diff: chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm

Issue 1775223002: Prepare chrome/ for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile errors. Fix null-window error. Created 4 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/cocoa/panels/panel_titlebar_view_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm
index f82f3f6a78d53c5cb2d15b7c76bb07c1af03a4ba..c7a9665a917f3557ed7df469ceea2abad95cbaff 100644
--- a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm
@@ -14,6 +14,7 @@
#include "grit/theme_resources.h"
#import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect.h"
#import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h"
+#include "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/hover_image_button.h"
#import "ui/base/cocoa/nsview_additions.h"
#include "ui/base/l10n/l10n_util_mac.h"
@@ -418,8 +419,8 @@ static NSEvent* MakeMouseEvent(NSEventType type,
}
- (void)dragStarted:(NSPoint)initialMouseLocation {
- NSPoint initialMouseLocationScreen =
- [[self window] convertBaseToScreen:initialMouseLocation];
+ NSPoint initialMouseLocationScreen = ui::ConvertPointFromWindowToScreen(
+ [self window], initialMouseLocation);
[controller_ startDrag:initialMouseLocationScreen];
}
@@ -428,8 +429,8 @@ static NSEvent* MakeMouseEvent(NSEventType type,
}
- (void)dragProgress:(NSPoint)mouseLocation {
- NSPoint mouseLocationScreen =
- [[self window] convertBaseToScreen:mouseLocation];
+ NSPoint mouseLocationScreen = ui::ConvertPointFromWindowToScreen(
+ [self window], mouseLocation);
[controller_ drag:mouseLocationScreen];
}
@@ -530,8 +531,8 @@ static NSEvent* MakeMouseEvent(NSEventType type,
dragController_.reset([[TestDragController alloc] initWithClient:self]);
// Convert from Cocoa's screen coordinates to base coordinates since the mouse
// event takes base (NSWindow) coordinates.
- NSPoint mouseLocationWindow =
- [[self window] convertScreenToBase:mouseLocation];
+ NSPoint mouseLocationWindow = ui::ConvertPointFromScreenToWindow(
+ [self window], mouseLocation);
NSEvent* event = MakeMouseEvent(NSLeftMouseDown, mouseLocationWindow,
modifierFlags, 0);
[self mouseDown:event];
@@ -545,8 +546,8 @@ static NSEvent* MakeMouseEvent(NSEventType type,
- (void)dragTitlebar:(NSPoint)mouseLocation {
// Convert from Cocoa's screen coordinates to base coordinates since the mouse
// event takes base (NSWindow) coordinates.
- NSPoint mouseLocationWindow =
- [[self window] convertScreenToBase:mouseLocation];
+ NSPoint mouseLocationWindow = ui::ConvertPointFromScreenToWindow(
+ [self window], mouseLocation);
NSEvent* event =
MakeMouseEvent(NSLeftMouseDragged, mouseLocationWindow, 0, 0);
[self mouseDragged:event];

Powered by Google App Engine
This is Rietveld 408576698