OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/net_internals_ui.h" | 5 #include "chrome/browser/ui/webui/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 Value::CreateBooleanValue( | 1167 Value::CreateBooleanValue( |
1168 net::HttpStreamFactory::use_alternate_protocols())); | 1168 net::HttpStreamFactory::use_alternate_protocols())); |
1169 status_dict->Set("force_spdy_over_ssl", | 1169 status_dict->Set("force_spdy_over_ssl", |
1170 Value::CreateBooleanValue( | 1170 Value::CreateBooleanValue( |
1171 net::HttpStreamFactory::force_spdy_over_ssl())); | 1171 net::HttpStreamFactory::force_spdy_over_ssl())); |
1172 status_dict->Set("force_spdy_always", | 1172 status_dict->Set("force_spdy_always", |
1173 Value::CreateBooleanValue( | 1173 Value::CreateBooleanValue( |
1174 net::HttpStreamFactory::force_spdy_always())); | 1174 net::HttpStreamFactory::force_spdy_always())); |
1175 | 1175 |
1176 // The next_protos may not be specified for certain configurations of SPDY. | 1176 // The next_protos may not be specified for certain configurations of SPDY. |
1177 Value* next_protos_value = net::HttpStreamFactory::next_protos() ? | 1177 Value* next_protos_value; |
1178 Value::CreateStringValue(*net::HttpStreamFactory::next_protos()) : | 1178 if (net::HttpStreamFactory::has_next_protos()) { |
1179 Value::CreateStringValue(""); | 1179 next_protos_value = Value::CreateStringValue( |
1180 | 1180 JoinString(net::HttpStreamFactory::next_protos(), ',')); |
| 1181 } else { |
| 1182 next_protos_value = Value::CreateStringValue(""); |
| 1183 } |
1181 status_dict->Set("next_protos", next_protos_value); | 1184 status_dict->Set("next_protos", next_protos_value); |
1182 | 1185 |
1183 SendJavascriptCommand("receivedSpdyStatus", status_dict); | 1186 SendJavascriptCommand("receivedSpdyStatus", status_dict); |
1184 } | 1187 } |
1185 | 1188 |
1186 void | 1189 void |
1187 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( | 1190 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( |
1188 const ListValue* list) { | 1191 const ListValue* list) { |
1189 ListValue* dict_list = new ListValue(); | 1192 ListValue* dict_list = new ListValue(); |
1190 | 1193 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 return constants_dict; | 1532 return constants_dict; |
1530 } | 1533 } |
1531 | 1534 |
1532 NetInternalsUI::NetInternalsUI(TabContents* contents) : ChromeWebUI(contents) { | 1535 NetInternalsUI::NetInternalsUI(TabContents* contents) : ChromeWebUI(contents) { |
1533 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this)); | 1536 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this)); |
1534 | 1537 |
1535 // Set up the chrome://net-internals/ source. | 1538 // Set up the chrome://net-internals/ source. |
1536 GetProfile()->GetChromeURLDataManager()->AddDataSource( | 1539 GetProfile()->GetChromeURLDataManager()->AddDataSource( |
1537 CreateNetInternalsHTMLSource()); | 1540 CreateNetInternalsHTMLSource()); |
1538 } | 1541 } |
OLD | NEW |