OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_drag_source_mac.h" | 5 #import "content/browser/web_contents/web_drag_source_mac.h" |
6 | 6 |
7 #include <sys/param.h> | 7 #include <sys/param.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/pickle.h" | 11 #include "base/pickle.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "content/browser/browser_thread_impl.h" | 17 #include "content/browser/browser_thread_impl.h" |
18 #include "content/browser/download/drag_download_file.h" | 18 #include "content/browser/download/drag_download_file.h" |
19 #include "content/browser/download/drag_download_util.h" | 19 #include "content/browser/download/drag_download_util.h" |
20 #include "content/browser/renderer_host/render_view_host_impl.h" | 20 #include "content/browser/renderer_host/render_view_host_impl.h" |
21 #include "content/browser/web_contents/web_contents_impl.h" | 21 #include "content/browser/web_contents/web_contents_impl.h" |
22 #include "content/public/browser/content_browser_client.h" | 22 #include "content/public/browser/content_browser_client.h" |
23 #include "content/public/common/content_client.h" | 23 #include "content/public/common/content_client.h" |
24 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
| 25 #include "grit/ui_resources_standard.h" |
25 #include "net/base/escape.h" | 26 #include "net/base/escape.h" |
26 #include "net/base/file_stream.h" | 27 #include "net/base/file_stream.h" |
27 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" |
28 #include "ui/base/clipboard/custom_data_helper.h" | 29 #include "ui/base/clipboard/custom_data_helper.h" |
29 #include "ui/base/dragdrop/cocoa_dnd_util.h" | 30 #include "ui/base/dragdrop/cocoa_dnd_util.h" |
| 31 #include "ui/gfx/image/image.h" |
30 #include "ui/gfx/mac/nsimage_cache.h" | 32 #include "ui/gfx/mac/nsimage_cache.h" |
31 #include "webkit/glue/webdropdata.h" | 33 #include "webkit/glue/webdropdata.h" |
32 | 34 |
33 using base::SysNSStringToUTF8; | 35 using base::SysNSStringToUTF8; |
34 using base::SysUTF8ToNSString; | 36 using base::SysUTF8ToNSString; |
35 using base::SysUTF16ToNSString; | 37 using base::SysUTF16ToNSString; |
36 using content::BrowserThread; | 38 using content::BrowserThread; |
37 using content::RenderViewHostImpl; | 39 using content::RenderViewHostImpl; |
38 using net::FileStream; | 40 using net::FileStream; |
39 | 41 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 addTypes:[NSArray arrayWithObject:ui::kWebCustomDataPboardType] | 450 addTypes:[NSArray arrayWithObject:ui::kWebCustomDataPboardType] |
449 owner:contentsView_]; | 451 owner:contentsView_]; |
450 } | 452 } |
451 } | 453 } |
452 | 454 |
453 - (NSImage*)dragImage { | 455 - (NSImage*)dragImage { |
454 if (dragImage_) | 456 if (dragImage_) |
455 return dragImage_; | 457 return dragImage_; |
456 | 458 |
457 // Default to returning a generic image. | 459 // Default to returning a generic image. |
458 return gfx::GetCachedImageWithName(@"nav.pdf"); | 460 return content::GetContentClient()->GetNativeImageNamed(IDR_DEFAULT_FAVICON); |
459 } | 461 } |
460 | 462 |
461 @end // @implementation WebDragSource (Private) | 463 @end // @implementation WebDragSource (Private) |
OLD | NEW |