OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/utility/extensions/extensions_handler.h" | 5 #include "chrome/utility/extensions/extensions_handler.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
10 #include "chrome/common/extensions/chrome_extensions_client.h" | 10 #include "chrome/common/extensions/chrome_extensions_client.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 if (!base::Base64Decode(encoded_string, &decoded_string)) { | 175 if (!base::Base64Decode(encoded_string, &decoded_string)) { |
176 Send(new ChromeUtilityHostMsg_DecodeImage_Failed()); | 176 Send(new ChromeUtilityHostMsg_DecodeImage_Failed()); |
177 return; | 177 return; |
178 } | 178 } |
179 | 179 |
180 std::vector<unsigned char> decoded_vector(decoded_string.size()); | 180 std::vector<unsigned char> decoded_vector(decoded_string.size()); |
181 for (size_t i = 0; i < decoded_string.size(); ++i) { | 181 for (size_t i = 0; i < decoded_string.size(); ++i) { |
182 decoded_vector[i] = static_cast<unsigned char>(decoded_string[i]); | 182 decoded_vector[i] = static_cast<unsigned char>(decoded_string[i]); |
183 } | 183 } |
184 | 184 |
185 ChromeContentUtilityClient::DecodeImageAndSend(decoded_vector, false); | 185 ChromeContentUtilityClient::DecodeImage(decoded_vector); |
186 } | 186 } |
187 | 187 |
188 void ExtensionsHandler::OnParseJSON(const std::string& json) { | 188 void ExtensionsHandler::OnParseJSON(const std::string& json) { |
189 int error_code; | 189 int error_code; |
190 std::string error; | 190 std::string error; |
191 base::Value* value = base::JSONReader::ReadAndReturnError( | 191 base::Value* value = base::JSONReader::ReadAndReturnError( |
192 json, base::JSON_PARSE_RFC, &error_code, &error); | 192 json, base::JSON_PARSE_RFC, &error_code, &error); |
193 if (value) { | 193 if (value) { |
194 base::ListValue wrapper; | 194 base::ListValue wrapper; |
195 wrapper.Append(value); | 195 wrapper.Append(value); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 std::string key_data; | 289 std::string key_data; |
290 std::string error; | 290 std::string error; |
291 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 291 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
292 | 292 |
293 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 293 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
294 } | 294 } |
295 #endif // defined(OS_WIN) | 295 #endif // defined(OS_WIN) |
296 | 296 |
297 } // namespace extensions | 297 } // namespace extensions |
OLD | NEW |