OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/signed_in_devices/signed_in_devices_api.
h" | 5 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.
h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" | 10 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 pss, | 85 pss, |
86 extension_prefs); | 86 extension_prefs); |
87 } | 87 } |
88 | 88 |
89 scoped_ptr<DeviceInfo> GetLocalDeviceInfo(const std::string& extension_id, | 89 scoped_ptr<DeviceInfo> GetLocalDeviceInfo(const std::string& extension_id, |
90 Profile* profile) { | 90 Profile* profile) { |
91 ProfileSyncService* pss = ProfileSyncServiceFactory::GetForProfile(profile); | 91 ProfileSyncService* pss = ProfileSyncServiceFactory::GetForProfile(profile); |
92 if (!pss) { | 92 if (!pss) { |
93 return scoped_ptr<DeviceInfo>(); | 93 return scoped_ptr<DeviceInfo>(); |
94 } | 94 } |
95 std::string guid = pss->GetLocalDeviceGUID(); | 95 std::string guid = pss->GetLocalSyncCacheGUID(); |
96 scoped_ptr<DeviceInfo> device = GetDeviceInfoForClientId(guid, | 96 scoped_ptr<DeviceInfo> device = GetDeviceInfoForClientId(guid, |
97 extension_id, | 97 extension_id, |
98 profile); | 98 profile); |
99 return device.Pass(); | 99 return device.Pass(); |
100 } | 100 } |
101 | 101 |
102 bool SignedInDevicesGetFunction::RunImpl() { | 102 bool SignedInDevicesGetFunction::RunImpl() { |
103 scoped_ptr<api::signed_in_devices::Get::Params> params( | 103 scoped_ptr<api::signed_in_devices::Get::Params> params( |
104 api::signed_in_devices::Get::Params::Create(*args_)); | 104 api::signed_in_devices::Get::Params::Create(*args_)); |
105 EXTENSION_FUNCTION_VALIDATE(params.get()); | 105 EXTENSION_FUNCTION_VALIDATE(params.get()); |
(...skipping 21 matching lines...) Expand all Loading... |
127 ++it) { | 127 ++it) { |
128 result->Append((*it)->ToValue()); | 128 result->Append((*it)->ToValue()); |
129 } | 129 } |
130 | 130 |
131 SetResult(result.release()); | 131 SetResult(result.release()); |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 } // namespace extensions | 135 } // namespace extensions |
136 | 136 |
OLD | NEW |