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 <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 BrowserThread::UI, | 92 BrowserThread::UI, |
93 FROM_HERE, | 93 FROM_HERE, |
94 Bind(&SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem, this, | 94 Bind(&SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem, this, |
95 error)); | 95 error)); |
96 return; | 96 return; |
97 } | 97 } |
98 | 98 |
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
100 if (error != base::PLATFORM_FILE_OK) { | 100 if (error != base::PLATFORM_FILE_OK) { |
101 error_ = base::StringPrintf(kFileError, static_cast<int>(error)); | 101 error_ = base::StringPrintf(kFileError, static_cast<int>(error)); |
102 SetResult(base::Value::CreateBooleanValue(false)); | 102 SetResult(new base::FundamentalValue(false)); |
103 SendResponse(false); | 103 SendResponse(false); |
104 return; | 104 return; |
105 } | 105 } |
106 | 106 |
107 SetResult(base::Value::CreateBooleanValue(true)); | 107 SetResult(new base::FundamentalValue(true)); |
108 SendResponse(true); | 108 SendResponse(true); |
109 } | 109 } |
110 | 110 |
111 bool SyncFileSystemRequestFileSystemFunction::RunImpl() { | 111 bool SyncFileSystemRequestFileSystemFunction::RunImpl() { |
112 // Initializes sync context for this extension and continue to open | 112 // Initializes sync context for this extension and continue to open |
113 // a new file system. | 113 // a new file system. |
114 GetSyncFileSystemService(profile())-> | 114 GetSyncFileSystemService(profile())-> |
115 InitializeForApp( | 115 InitializeForApp( |
116 GetFileSystemContext(), | 116 GetFileSystemContext(), |
117 source_url().GetOrigin(), | 117 source_url().GetOrigin(), |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 return true; | 373 return true; |
374 } | 374 } |
375 | 375 |
376 bool SyncFileSystemGetConflictResolutionPolicyFunction::RunImpl() { | 376 bool SyncFileSystemGetConflictResolutionPolicyFunction::RunImpl() { |
377 sync_file_system::SyncFileSystemService* service = GetSyncFileSystemService( | 377 sync_file_system::SyncFileSystemService* service = GetSyncFileSystemService( |
378 profile()); | 378 profile()); |
379 DCHECK(service); | 379 DCHECK(service); |
380 api::sync_file_system::ConflictResolutionPolicy policy = | 380 api::sync_file_system::ConflictResolutionPolicy policy = |
381 ConflictResolutionPolicyToExtensionEnum( | 381 ConflictResolutionPolicyToExtensionEnum( |
382 service->GetConflictResolutionPolicy()); | 382 service->GetConflictResolutionPolicy()); |
383 SetResult(Value::CreateStringValue( | 383 SetResult(new base::StringValue( |
384 api::sync_file_system::ToString(policy))); | 384 api::sync_file_system::ToString(policy))); |
385 return true; | 385 return true; |
386 } | 386 } |
387 | 387 |
388 } // namespace extensions | 388 } // namespace extensions |
OLD | NEW |