| 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 #include "chrome/browser/chromeos/drive/download_handler.h" | 5 #include "chrome/browser/chromeos/drive/download_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 NOTREACHED(); | 375 NOTREACHED(); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 void DownloadHandler::OnCreateDirectory( | 379 void DownloadHandler::OnCreateDirectory( |
| 380 const SubstituteDriveDownloadPathCallback& callback, | 380 const SubstituteDriveDownloadPathCallback& callback, |
| 381 FileError error) { | 381 FileError error) { |
| 382 DVLOG(1) << "OnCreateDirectory " << FileErrorToString(error); | 382 DVLOG(1) << "OnCreateDirectory " << FileErrorToString(error); |
| 383 if (error == FILE_ERROR_OK) { | 383 if (error == FILE_ERROR_OK) { |
| 384 base::PostTaskWithTraitsAndReplyWithResult( | 384 base::PostTaskWithTraitsAndReplyWithResult( |
| 385 FROM_HERE, base::TaskTraits().MayBlock(), | 385 FROM_HERE, {base::MayBlock()}, |
| 386 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), | 386 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), |
| 387 callback); | 387 callback); |
| 388 } else { | 388 } else { |
| 389 LOG(WARNING) << "Failed to create directory, error = " | 389 LOG(WARNING) << "Failed to create directory, error = " |
| 390 << FileErrorToString(error); | 390 << FileErrorToString(error); |
| 391 callback.Run(base::FilePath()); | 391 callback.Run(base::FilePath()); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 void DownloadHandler::UploadDownloadItem(DownloadManager* manager, | 395 void DownloadHandler::UploadDownloadItem(DownloadManager* manager, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 426 | 426 |
| 427 DownloadManager* DownloadHandler::GetDownloadManager(void* manager_id) { | 427 DownloadManager* DownloadHandler::GetDownloadManager(void* manager_id) { |
| 428 if (manager_id == notifier_->GetManager()) | 428 if (manager_id == notifier_->GetManager()) |
| 429 return notifier_->GetManager(); | 429 return notifier_->GetManager(); |
| 430 if (notifier_incognito_ && manager_id == notifier_incognito_->GetManager()) | 430 if (notifier_incognito_ && manager_id == notifier_incognito_->GetManager()) |
| 431 return notifier_incognito_->GetManager(); | 431 return notifier_incognito_->GetManager(); |
| 432 return NULL; | 432 return NULL; |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace drive | 435 } // namespace drive |
| OLD | NEW |