| 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/extensions/api/sync_file_system/sync_file_system_api.h" | 5 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 BrowserThread::UI, | 101 BrowserThread::UI, |
| 102 FROM_HERE, | 102 FROM_HERE, |
| 103 Bind(&SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem, this, | 103 Bind(&SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem, this, |
| 104 error)); | 104 error)); |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 | 107 |
| 108 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 108 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 109 if (error != base::File::FILE_OK) { | 109 if (error != base::File::FILE_OK) { |
| 110 error_ = ErrorToString(sync_file_system::FileErrorToSyncStatusCode(error)); | 110 error_ = ErrorToString(sync_file_system::FileErrorToSyncStatusCode(error)); |
| 111 SetResult(base::MakeUnique<base::FundamentalValue>(false)); | 111 SetResult(base::MakeUnique<base::Value>(false)); |
| 112 SendResponse(false); | 112 SendResponse(false); |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 | 115 |
| 116 SetResult(base::MakeUnique<base::FundamentalValue>(true)); | 116 SetResult(base::MakeUnique<base::Value>(true)); |
| 117 SendResponse(true); | 117 SendResponse(true); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool SyncFileSystemRequestFileSystemFunction::RunAsync() { | 120 bool SyncFileSystemRequestFileSystemFunction::RunAsync() { |
| 121 // SyncFileSystem initialization is done in OpenFileSystem below, but we call | 121 // SyncFileSystem initialization is done in OpenFileSystem below, but we call |
| 122 // GetSyncFileSystemService here too to initialize sync event observer for | 122 // GetSyncFileSystemService here too to initialize sync event observer for |
| 123 // extensions API. | 123 // extensions API. |
| 124 if (!GetSyncFileSystemService(GetProfile())) | 124 if (!GetSyncFileSystemService(GetProfile())) |
| 125 return false; | 125 return false; |
| 126 | 126 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 sync_file_system::SyncFileSystemService* service = | 381 sync_file_system::SyncFileSystemService* service = |
| 382 GetSyncFileSystemService(browser_context()); | 382 GetSyncFileSystemService(browser_context()); |
| 383 if (!service) | 383 if (!service) |
| 384 return RespondNow(Error(kUnknownErrorDoNotUse)); | 384 return RespondNow(Error(kUnknownErrorDoNotUse)); |
| 385 return RespondNow( | 385 return RespondNow( |
| 386 ArgumentList(api::sync_file_system::GetServiceStatus::Results::Create( | 386 ArgumentList(api::sync_file_system::GetServiceStatus::Results::Create( |
| 387 SyncServiceStateToExtensionEnum(service->GetSyncServiceState())))); | 387 SyncServiceStateToExtensionEnum(service->GetSyncServiceState())))); |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace extensions | 390 } // namespace extensions |
| OLD | NEW |