Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: chrome/browser/extensions/api/proxy/proxy_api.cc

Issue 1410333006: Enough hacks to make wstring printfs unneeded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 the Chrome Extensions Proxy Settings API. 5 // Implementation of the Chrome Extensions Proxy Settings API.
6 6
7 #include "chrome/browser/extensions/api/proxy/proxy_api.h" 7 #include "chrome/browser/extensions/api/proxy/proxy_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void* profile, 60 void* profile,
61 int line_number, 61 int line_number,
62 const base::string16& error) { 62 const base::string16& error) {
63 scoped_ptr<base::ListValue> args(new base::ListValue()); 63 scoped_ptr<base::ListValue> args(new base::ListValue());
64 base::DictionaryValue* dict = new base::DictionaryValue(); 64 base::DictionaryValue* dict = new base::DictionaryValue();
65 dict->SetBoolean(keys::kProxyEventFatal, false); 65 dict->SetBoolean(keys::kProxyEventFatal, false);
66 dict->SetString(keys::kProxyEventError, 66 dict->SetString(keys::kProxyEventError,
67 net::ErrorToString(net::ERR_PAC_SCRIPT_FAILED)); 67 net::ErrorToString(net::ERR_PAC_SCRIPT_FAILED));
68 std::string error_msg; 68 std::string error_msg;
69 if (line_number != -1) { 69 if (line_number != -1) {
70 base::SStringPrintf(&error_msg, 70 /*base::SStringPrintf(&error_msg,
71 "line: %d: %s", 71 "line: %d: %s",
72 line_number, base::UTF16ToUTF8(error).c_str()); 72 line_number, base::UTF16ToUTF8(error).c_str());*/
brucedawson 2015/10/20 21:43:00 Printing of UTF16ToUTF8 error string - seems very
73 } else { 73 } else {
74 error_msg = base::UTF16ToUTF8(error); 74 error_msg = base::UTF16ToUTF8(error);
75 } 75 }
76 dict->SetString(keys::kProxyEventDetails, error_msg); 76 dict->SetString(keys::kProxyEventDetails, error_msg);
77 args->Append(dict); 77 args->Append(dict);
78 78
79 if (profile) { 79 if (profile) {
80 event_router->DispatchEventToRenderers(events::PROXY_ON_PROXY_ERROR, 80 event_router->DispatchEventToRenderers(events::PROXY_ON_PROXY_ERROR,
81 keys::kProxyEventOnProxyError, 81 keys::kProxyEventOnProxyError,
82 args.Pass(), profile, true, GURL()); 82 args.Pass(), profile, true, GURL());
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 extension_pref->Set(keys::kProxyConfigRules, proxy_rules_dict); 181 extension_pref->Set(keys::kProxyConfigRules, proxy_rules_dict);
182 break; 182 break;
183 } 183 }
184 case ProxyPrefs::kModeCount: 184 case ProxyPrefs::kModeCount:
185 NOTREACHED(); 185 NOTREACHED();
186 } 186 }
187 return extension_pref.release(); 187 return extension_pref.release();
188 } 188 }
189 189
190 } // namespace extensions 190 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698