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

Side by Side Diff: chrome/browser/ui/cocoa/web_contents_drag_source.mm

Issue 5961007: Move nsimage_cache from base to app/mac. Use the app::mac namespace. Update c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
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 #import "chrome/browser/ui/cocoa/web_contents_drag_source.h" 5 #import "chrome/browser/ui/cocoa/web_contents_drag_source.h"
6 6
7 #include "base/nsimage_cache_mac.h" 7 #include "base/nsimage_cache.h"
Avi (use Gerrit) 2010/12/22 19:06:38 app/mac/?
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/renderer_host/render_view_host.h" 10 #include "chrome/browser/renderer_host/render_view_host.h"
11 #include "chrome/browser/tab_contents/tab_contents.h" 11 #include "chrome/browser/tab_contents/tab_contents.h"
12 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" 12 #include "chrome/browser/tab_contents/tab_contents_view_mac.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Make a drag image from the drop data. 16 // Make a drag image from the drop data.
17 // TODO(feldstein): Make this work 17 // TODO(feldstein): Make this work
18 NSImage* MakeDragImage() { 18 NSImage* MakeDragImage() {
19 // TODO(feldstein): Just a stub for now. Make it do something (see, e.g., 19 // TODO(feldstein): Just a stub for now. Make it do something (see, e.g.,
20 // WebKit/WebKit/mac/Misc/WebNSViewExtras.m: |-_web_DragImageForElement:...|). 20 // WebKit/WebKit/mac/Misc/WebNSViewExtras.m: |-_web_DragImageForElement:...|).
21 21
22 // Default to returning a generic image. 22 // Default to returning a generic image.
23 return nsimage_cache::ImageNamed(@"nav.pdf"); 23 return app::mac::GetCachedImageWithName(@"nav.pdf");
24 } 24 }
25 25
26 // Flips screen and point coordinates over the y axis to work with webkit 26 // Flips screen and point coordinates over the y axis to work with webkit
27 // coordinate systems. 27 // coordinate systems.
28 void FlipPointCoordinates(NSPoint& screenPoint, 28 void FlipPointCoordinates(NSPoint& screenPoint,
29 NSPoint& localPoint, 29 NSPoint& localPoint,
30 NSView* view) { 30 NSView* view) {
31 NSRect viewFrame = [view frame]; 31 NSRect viewFrame = [view frame];
32 localPoint.y = NSHeight(viewFrame) - localPoint.y; 32 localPoint.y = NSHeight(viewFrame) - localPoint.y;
33 // Flip |screenPoint|. 33 // Flip |screenPoint|.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (rvh) { 121 if (rvh) {
122 NSPoint localPoint = [contentsView_ convertPoint:screenPoint fromView:nil]; 122 NSPoint localPoint = [contentsView_ convertPoint:screenPoint fromView:nil];
123 FlipPointCoordinates(screenPoint, localPoint, contentsView_); 123 FlipPointCoordinates(screenPoint, localPoint, contentsView_);
124 rvh->DragSourceMovedTo(localPoint.x, localPoint.y, 124 rvh->DragSourceMovedTo(localPoint.x, localPoint.y,
125 screenPoint.x, screenPoint.y); 125 screenPoint.x, screenPoint.y);
126 } 126 }
127 } 127 }
128 128
129 @end // @implementation WebContentsDragSource 129 @end // @implementation WebContentsDragSource
130 130
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698