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/id_mapping_helper.h" | 5 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.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/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 DCHECK(crx_file::id_util::IdIsValid(extension_id)) << extension_id | 91 DCHECK(crx_file::id_util::IdIsValid(extension_id)) << extension_id |
92 << " is not valid"; | 92 << " is not valid"; |
93 ScopedVector<DeviceInfo> devices = GetAllSignedInDevices(extension_id, | 93 ScopedVector<DeviceInfo> devices = GetAllSignedInDevices(extension_id, |
94 profile); | 94 profile); |
95 for (ScopedVector<DeviceInfo>::iterator it = devices.begin(); | 95 for (ScopedVector<DeviceInfo>::iterator it = devices.begin(); |
96 it != devices.end(); | 96 it != devices.end(); |
97 ++it) { | 97 ++it) { |
98 if ((*it)->guid() == client_id) { | 98 if ((*it)->guid() == client_id) { |
99 scoped_ptr<DeviceInfo> device(*it); | 99 scoped_ptr<DeviceInfo> device(*it); |
100 devices.weak_erase(it); | 100 devices.weak_erase(it); |
101 return device.Pass(); | 101 return device; |
102 } | 102 } |
103 } | 103 } |
104 return scoped_ptr<DeviceInfo>(); | 104 return scoped_ptr<DeviceInfo>(); |
105 } | 105 } |
106 | 106 |
107 } // namespace extensions | 107 } // namespace extensions |
OLD | NEW |