| 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/push_messaging/obfuscated_gaia_id_fetche
r.h" | 5 #include "chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetche
r.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 // static | 122 // static |
| 123 bool ObfuscatedGaiaIdFetcher::ParseResponse( | 123 bool ObfuscatedGaiaIdFetcher::ParseResponse( |
| 124 const std::string& data, std::string* result) { | 124 const std::string& data, std::string* result) { |
| 125 scoped_ptr<base::Value> value(base::JSONReader::Read(data)); | 125 scoped_ptr<base::Value> value(base::JSONReader::Read(data)); |
| 126 | 126 |
| 127 if (!value.get()) | 127 if (!value.get()) |
| 128 return false; | 128 return false; |
| 129 | 129 |
| 130 DictionaryValue* dict = NULL; | 130 base::DictionaryValue* dict = NULL; |
| 131 if (!value->GetAsDictionary(&dict)) | 131 if (!value->GetAsDictionary(&dict)) |
| 132 return false; | 132 return false; |
| 133 | 133 |
| 134 return dict->GetString("id", result); | 134 return dict->GetString("id", result); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace extensions | 137 } // namespace extensions |
| OLD | NEW |