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 "google_apis/gaia/oauth2_mint_token_flow.h" | 5 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return false; | 251 return false; |
252 | 252 |
253 const base::ListValue* scopes_list = NULL; | 253 const base::ListValue* scopes_list = NULL; |
254 if (!consent_dict->GetList(kScopesKey, &scopes_list)) | 254 if (!consent_dict->GetList(kScopesKey, &scopes_list)) |
255 return false; | 255 return false; |
256 | 256 |
257 bool success = true; | 257 bool success = true; |
258 for (size_t index = 0; index < scopes_list->GetSize(); ++index) { | 258 for (size_t index = 0; index < scopes_list->GetSize(); ++index) { |
259 const base::DictionaryValue* scopes_entry = NULL; | 259 const base::DictionaryValue* scopes_entry = NULL; |
260 IssueAdviceInfoEntry entry; | 260 IssueAdviceInfoEntry entry; |
261 string16 detail; | 261 base::string16 detail; |
262 if (!scopes_list->GetDictionary(index, &scopes_entry) || | 262 if (!scopes_list->GetDictionary(index, &scopes_entry) || |
263 !scopes_entry->GetString(kDescriptionKey, &entry.description) || | 263 !scopes_entry->GetString(kDescriptionKey, &entry.description) || |
264 !scopes_entry->GetString(kDetailKey, &detail)) { | 264 !scopes_entry->GetString(kDetailKey, &detail)) { |
265 success = false; | 265 success = false; |
266 break; | 266 break; |
267 } | 267 } |
268 | 268 |
269 TrimWhitespace(entry.description, TRIM_ALL, &entry.description); | 269 TrimWhitespace(entry.description, TRIM_ALL, &entry.description); |
270 static const string16 detail_separators = ASCIIToUTF16(kDetailSeparators); | 270 static const base::string16 detail_separators = |
| 271 ASCIIToUTF16(kDetailSeparators); |
271 Tokenize(detail, detail_separators, &entry.details); | 272 Tokenize(detail, detail_separators, &entry.details); |
272 for (size_t i = 0; i < entry.details.size(); i++) | 273 for (size_t i = 0; i < entry.details.size(); i++) |
273 TrimWhitespace(entry.details[i], TRIM_ALL, &entry.details[i]); | 274 TrimWhitespace(entry.details[i], TRIM_ALL, &entry.details[i]); |
274 issue_advice->push_back(entry); | 275 issue_advice->push_back(entry); |
275 } | 276 } |
276 | 277 |
277 if (!success) | 278 if (!success) |
278 issue_advice->clear(); | 279 issue_advice->clear(); |
279 | 280 |
280 return success; | 281 return success; |
281 } | 282 } |
OLD | NEW |