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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 api::sync_file_system::ParseConflictResolutionPolicy(policy_string)); | 364 api::sync_file_system::ParseConflictResolutionPolicy(policy_string)); |
365 if (policy != sync_file_system::CONFLICT_RESOLUTION_POLICY_LAST_WRITE_WIN) { | 365 if (policy != sync_file_system::CONFLICT_RESOLUTION_POLICY_LAST_WRITE_WIN) { |
366 return RespondNow(Error(base::StringPrintf( | 366 return RespondNow(Error(base::StringPrintf( |
367 kUnsupportedConflictResolutionPolicy, policy_string.c_str()))); | 367 kUnsupportedConflictResolutionPolicy, policy_string.c_str()))); |
368 } | 368 } |
369 return RespondNow(NoArguments()); | 369 return RespondNow(NoArguments()); |
370 } | 370 } |
371 | 371 |
372 ExtensionFunction::ResponseAction | 372 ExtensionFunction::ResponseAction |
373 SyncFileSystemGetConflictResolutionPolicyFunction::Run() { | 373 SyncFileSystemGetConflictResolutionPolicyFunction::Run() { |
374 return RespondNow(OneArgument( | 374 return RespondNow( |
375 base::MakeUnique<base::StringValue>(api::sync_file_system::ToString( | 375 OneArgument(base::MakeUnique<base::Value>(api::sync_file_system::ToString( |
376 api::sync_file_system::CONFLICT_RESOLUTION_POLICY_LAST_WRITE_WIN)))); | 376 api::sync_file_system::CONFLICT_RESOLUTION_POLICY_LAST_WRITE_WIN)))); |
377 } | 377 } |
378 | 378 |
379 ExtensionFunction::ResponseAction | 379 ExtensionFunction::ResponseAction |
380 SyncFileSystemGetServiceStatusFunction::Run() { | 380 SyncFileSystemGetServiceStatusFunction::Run() { |
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 |