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 // Implementation of helper functions for the Chrome Extensions Proxy Settings | 5 // Implementation of helper functions for the Chrome Extensions Proxy Settings |
6 // API. | 6 // API. |
7 // | 7 // |
8 // Throughout this code, we report errors to the user by setting an |error| | 8 // Throughout this code, we report errors to the user by setting an |error| |
9 // parameter, if and only if these errors can be cause by invalid input | 9 // parameter, if and only if these errors can be cause by invalid input |
10 // from the extension and we cannot expect that the extensions API has | 10 // from the extension and we cannot expect that the extensions API has |
11 // caught this error before. In all other cases we are dealing with internal | 11 // caught this error before. In all other cases we are dealing with internal |
12 // errors and log to LOG(ERROR). | 12 // errors and log to LOG(ERROR). |
13 | 13 |
14 #include "chrome/browser/extensions/api/proxy/proxy_api_helpers.h" | 14 #include "chrome/browser/extensions/api/proxy/proxy_api_helpers.h" |
15 | 15 |
16 #include "base/base64.h" | 16 #include "base/base64.h" |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/strings/string_tokenizer.h" | 19 #include "base/strings/string_tokenizer.h" |
20 #include "base/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/values.h" | 21 #include "base/values.h" |
22 #include "chrome/browser/extensions/api/proxy/proxy_api_constants.h" | 22 #include "chrome/browser/extensions/api/proxy/proxy_api_constants.h" |
23 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 23 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
24 #include "extensions/common/error_utils.h" | 24 #include "extensions/common/error_utils.h" |
25 #include "net/base/data_url.h" | 25 #include "net/base/data_url.h" |
26 #include "net/proxy/proxy_config.h" | 26 #include "net/proxy/proxy_config.h" |
27 | 27 |
28 namespace extensions { | 28 namespace extensions { |
29 | 29 |
30 namespace keys = proxy_api_constants; | 30 namespace keys = proxy_api_constants; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 const std::string& delims) { | 485 const std::string& delims) { |
486 ListValue* out = new ListValue; | 486 ListValue* out = new ListValue; |
487 base::StringTokenizer entries(in, delims); | 487 base::StringTokenizer entries(in, delims); |
488 while (entries.GetNext()) | 488 while (entries.GetNext()) |
489 out->Append(Value::CreateStringValue(entries.token())); | 489 out->Append(Value::CreateStringValue(entries.token())); |
490 return out; | 490 return out; |
491 } | 491 } |
492 | 492 |
493 } // namespace proxy_api_helpers | 493 } // namespace proxy_api_helpers |
494 } // namespace extensions | 494 } // namespace extensions |
OLD | NEW |