OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/cros/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 519 } |
520 } | 520 } |
521 return ipconfig_vector; | 521 return ipconfig_vector; |
522 } | 522 } |
523 | 523 |
524 std::string NetworkLibraryImpl::GetHtmlInfo(int refresh) { | 524 std::string NetworkLibraryImpl::GetHtmlInfo(int refresh) { |
525 std::string output; | 525 std::string output; |
526 output.append("<html><head><title>About Network</title>"); | 526 output.append("<html><head><title>About Network</title>"); |
527 if (refresh > 0) | 527 if (refresh > 0) |
528 output.append("<meta http-equiv=\"refresh\" content=\"" + | 528 output.append("<meta http-equiv=\"refresh\" content=\"" + |
529 IntToString(refresh) + "\"/>"); | 529 base::IntToString(refresh) + "\"/>"); |
530 output.append("</head><body>"); | 530 output.append("</head><body>"); |
531 if (refresh > 0) | 531 if (refresh > 0) { |
532 output.append("(Auto-refreshing page every " + IntToString(refresh) + "s)"); | 532 output.append("(Auto-refreshing page every " + |
533 else | 533 base::IntToString(refresh) + "s)"); |
| 534 } else { |
534 output.append("(To auto-refresh this page: about:network/<secs>)"); | 535 output.append("(To auto-refresh this page: about:network/<secs>)"); |
| 536 } |
535 | 537 |
536 output.append("<h3>Ethernet:</h3><table border=1>"); | 538 output.append("<h3>Ethernet:</h3><table border=1>"); |
537 output.append("<tr>" + ToHtmlTableHeader(ðernet_) + "</tr>"); | 539 output.append("<tr>" + ToHtmlTableHeader(ðernet_) + "</tr>"); |
538 output.append("<tr>" + ToHtmlTableRow(ðernet_) + "</tr>"); | 540 output.append("<tr>" + ToHtmlTableRow(ðernet_) + "</tr>"); |
539 | 541 |
540 output.append("</table><h3>Wifi:</h3><table border=1>"); | 542 output.append("</table><h3>Wifi:</h3><table border=1>"); |
541 for (size_t i = 0; i < wifi_networks_.size(); ++i) { | 543 for (size_t i = 0; i < wifi_networks_.size(); ++i) { |
542 if (i == 0) | 544 if (i == 0) |
543 output.append("<tr>" + ToHtmlTableHeader(&wifi_networks_[i]) + "</tr>"); | 545 output.append("<tr>" + ToHtmlTableHeader(&wifi_networks_[i]) + "</tr>"); |
544 output.append("<tr>" + ToHtmlTableRow(&wifi_networks_[i]) + "</tr>"); | 546 output.append("<tr>" + ToHtmlTableRow(&wifi_networks_[i]) + "</tr>"); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 if (ethernet_connected()) | 890 if (ethernet_connected()) |
889 return ethernet_.ip_address(); | 891 return ethernet_.ip_address(); |
890 if (wifi_connected()) | 892 if (wifi_connected()) |
891 return wifi_.ip_address(); | 893 return wifi_.ip_address(); |
892 if (cellular_connected()) | 894 if (cellular_connected()) |
893 return cellular_.ip_address(); | 895 return cellular_.ip_address(); |
894 return ethernet_.ip_address(); | 896 return ethernet_.ip_address(); |
895 } | 897 } |
896 | 898 |
897 } // namespace chromeos | 899 } // namespace chromeos |
OLD | NEW |