| 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/tab_contents/web_drag_source_mac.h" | 5 #import "content/browser/tab_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" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // is responsible for opening the file. It takes the drop data and an open file | 74 // is responsible for opening the file. It takes the drop data and an open file |
| 75 // stream. | 75 // stream. |
| 76 void PromiseWriterHelper(const WebDropData& drop_data, | 76 void PromiseWriterHelper(const WebDropData& drop_data, |
| 77 FileStream* file_stream) { | 77 FileStream* file_stream) { |
| 78 DCHECK(file_stream); | 78 DCHECK(file_stream); |
| 79 file_stream->Write(drop_data.file_contents.data(), | 79 file_stream->Write(drop_data.file_contents.data(), |
| 80 drop_data.file_contents.length(), | 80 drop_data.file_contents.length(), |
| 81 net::CompletionCallback()); | 81 net::CompletionCallback()); |
| 82 | 82 |
| 83 if (file_stream) | 83 if (file_stream) |
| 84 file_stream->Close(); | 84 file_stream->CloseSync(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace | 87 } // namespace |
| 88 | 88 |
| 89 | 89 |
| 90 @interface WebDragSource(Private) | 90 @interface WebDragSource(Private) |
| 91 | 91 |
| 92 - (void)fillPasteboard; | 92 - (void)fillPasteboard; |
| 93 - (NSImage*)dragImage; | 93 - (NSImage*)dragImage; |
| 94 | 94 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 - (NSImage*)dragImage { | 441 - (NSImage*)dragImage { |
| 442 if (dragImage_) | 442 if (dragImage_) |
| 443 return dragImage_; | 443 return dragImage_; |
| 444 | 444 |
| 445 // Default to returning a generic image. | 445 // Default to returning a generic image. |
| 446 return gfx::GetCachedImageWithName(@"nav.pdf"); | 446 return gfx::GetCachedImageWithName(@"nav.pdf"); |
| 447 } | 447 } |
| 448 | 448 |
| 449 @end // @implementation WebDragSource (Private) | 449 @end // @implementation WebDragSource (Private) |
| OLD | NEW |