| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (downloadURL_.is_valid()) { | 381 if (downloadURL_.is_valid()) { |
| 382 scoped_refptr<DragDownloadFile> dragFileDownloader(new DragDownloadFile( | 382 scoped_refptr<DragDownloadFile> dragFileDownloader(new DragDownloadFile( |
| 383 filePath, | 383 filePath, |
| 384 fileStream.Pass(), | 384 fileStream.Pass(), |
| 385 downloadURL_, | 385 downloadURL_, |
| 386 content::Referrer(contents_->GetURL(), dropData_->referrer_policy), | 386 content::Referrer(contents_->GetURL(), dropData_->referrer_policy), |
| 387 contents_->GetEncoding(), | 387 contents_->GetEncoding(), |
| 388 contents_)); | 388 contents_)); |
| 389 | 389 |
| 390 // The finalizer will take care of closing and deletion. | 390 // The finalizer will take care of closing and deletion. |
| 391 dragFileDownloader->Start(new PromiseFileFinalizer(dragFileDownloader)); | 391 dragFileDownloader->Start(new PromiseFileFinalizer( |
| 392 dragFileDownloader.get())); |
| 392 } else { | 393 } else { |
| 393 // The writer will take care of closing and deletion. | 394 // The writer will take care of closing and deletion. |
| 394 BrowserThread::PostTask(BrowserThread::FILE, | 395 BrowserThread::PostTask(BrowserThread::FILE, |
| 395 FROM_HERE, | 396 FROM_HERE, |
| 396 base::Bind(&PromiseWriterHelper, | 397 base::Bind(&PromiseWriterHelper, |
| 397 *dropData_, | 398 *dropData_, |
| 398 base::Passed(&fileStream))); | 399 base::Passed(&fileStream))); |
| 399 } | 400 } |
| 400 } | 401 } |
| 401 | 402 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 - (NSImage*)dragImage { | 501 - (NSImage*)dragImage { |
| 501 if (dragImage_) | 502 if (dragImage_) |
| 502 return dragImage_; | 503 return dragImage_; |
| 503 | 504 |
| 504 // Default to returning a generic image. | 505 // Default to returning a generic image. |
| 505 return content::GetContentClient()->GetNativeImageNamed( | 506 return content::GetContentClient()->GetNativeImageNamed( |
| 506 IDR_DEFAULT_FAVICON).ToNSImage(); | 507 IDR_DEFAULT_FAVICON).ToNSImage(); |
| 507 } | 508 } |
| 508 | 509 |
| 509 @end // @implementation WebDragSource (Private) | 510 @end // @implementation WebDragSource (Private) |
| OLD | NEW |