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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const char kErrorMessage[] = "%s (error code: %d)."; | 43 const char kErrorMessage[] = "%s (error code: %d)."; |
44 const char kUnsupportedConflictResolutionPolicy[] = | 44 const char kUnsupportedConflictResolutionPolicy[] = |
45 "Policy %s is not supported."; | 45 "Policy %s is not supported."; |
46 | 46 |
47 sync_file_system::SyncFileSystemService* GetSyncFileSystemService( | 47 sync_file_system::SyncFileSystemService* GetSyncFileSystemService( |
48 Profile* profile) { | 48 Profile* profile) { |
49 sync_file_system::SyncFileSystemService* service = | 49 sync_file_system::SyncFileSystemService* service = |
50 SyncFileSystemServiceFactory::GetForProfile(profile); | 50 SyncFileSystemServiceFactory::GetForProfile(profile); |
51 DCHECK(service); | 51 DCHECK(service); |
52 ExtensionSyncEventObserver* observer = | 52 ExtensionSyncEventObserver* observer = |
53 ExtensionSyncEventObserver::GetFactoryInstance()->GetForProfile(profile); | 53 ExtensionSyncEventObserver::GetFactoryInstance()->Get(profile); |
54 DCHECK(observer); | 54 DCHECK(observer); |
55 observer->InitializeForService(service); | 55 observer->InitializeForService(service); |
56 return service; | 56 return service; |
57 } | 57 } |
58 | 58 |
59 std::string ErrorToString(SyncStatusCode code) { | 59 std::string ErrorToString(SyncStatusCode code) { |
60 return base::StringPrintf( | 60 return base::StringPrintf( |
61 kErrorMessage, | 61 kErrorMessage, |
62 sync_file_system::SyncStatusCodeToString(code), | 62 sync_file_system::SyncStatusCodeToString(code), |
63 static_cast<int>(code)); | 63 static_cast<int>(code)); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 bool SyncFileSystemGetServiceStatusFunction::RunImpl() { | 376 bool SyncFileSystemGetServiceStatusFunction::RunImpl() { |
377 sync_file_system::SyncFileSystemService* service = | 377 sync_file_system::SyncFileSystemService* service = |
378 GetSyncFileSystemService(GetProfile()); | 378 GetSyncFileSystemService(GetProfile()); |
379 results_ = api::sync_file_system::GetServiceStatus::Results::Create( | 379 results_ = api::sync_file_system::GetServiceStatus::Results::Create( |
380 SyncServiceStateToExtensionEnum(service->GetSyncServiceState())); | 380 SyncServiceStateToExtensionEnum(service->GetSyncServiceState())); |
381 return true; | 381 return true; |
382 } | 382 } |
383 | 383 |
384 } // namespace extensions | 384 } // namespace extensions |
OLD | NEW |