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/browser/ssl/captive_portal_blocking_page.h" | 5 #include "chrome/browser/ssl/captive_portal_blocking_page.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 load_time_data->SetString("iconClass", "icon-offline"); | 90 load_time_data->SetString("iconClass", "icon-offline"); |
91 load_time_data->SetString("type", "CAPTIVE_PORTAL"); | 91 load_time_data->SetString("type", "CAPTIVE_PORTAL"); |
92 load_time_data->SetBoolean("overridable", false); | 92 load_time_data->SetBoolean("overridable", false); |
93 | 93 |
94 load_time_data->SetString( | 94 load_time_data->SetString( |
95 "primaryButtonText", | 95 "primaryButtonText", |
96 l10n_util::GetStringUTF16(IDS_CAPTIVE_PORTAL_BUTTON_OPEN_LOGIN_PAGE)); | 96 l10n_util::GetStringUTF16(IDS_CAPTIVE_PORTAL_BUTTON_OPEN_LOGIN_PAGE)); |
97 load_time_data->SetString("tabTitle", | 97 load_time_data->SetString("tabTitle", |
98 l10n_util::GetStringUTF16( | 98 l10n_util::GetStringUTF16( |
99 is_wifi_connection_ ? | 99 is_wifi_connection_ ? |
100 IDS_CAPTIVE_PORTAL_TITLE_WIFI : | 100 IDS_CAPTIVE_PORTAL_HEADING_WIFI : |
101 IDS_CAPTIVE_PORTAL_TITLE_WIRED)); | 101 IDS_CAPTIVE_PORTAL_HEADING_WIRED)); |
102 load_time_data->SetString("heading", | 102 load_time_data->SetString("heading", |
103 l10n_util::GetStringUTF16( | 103 l10n_util::GetStringUTF16( |
104 is_wifi_connection_ ? | 104 is_wifi_connection_ ? |
105 IDS_CAPTIVE_PORTAL_HEADING_WIFI : | 105 IDS_CAPTIVE_PORTAL_HEADING_WIFI : |
106 IDS_CAPTIVE_PORTAL_HEADING_WIRED)); | 106 IDS_CAPTIVE_PORTAL_HEADING_WIRED)); |
107 | 107 |
108 if (login_url_.spec() == captive_portal::CaptivePortalDetector::kDefaultURL) { | 108 if (login_url_.spec() == captive_portal::CaptivePortalDetector::kDefaultURL) { |
109 // Captive portal may intercept requests without HTTP redirects, in which | 109 // Captive portal may intercept requests without HTTP redirects, in which |
110 // case the login url would be the same as the captive portal detection url. | 110 // case the login url would be the same as the captive portal detection url. |
111 // Don't show the login url in that case. | 111 // Don't show the login url in that case. |
(...skipping 29 matching lines...) Expand all Loading... |
141 load_time_data->SetString("finalParagraph", base::string16()); | 141 load_time_data->SetString("finalParagraph", base::string16()); |
142 } | 142 } |
143 | 143 |
144 void CaptivePortalBlockingPage::CommandReceived(const std::string& command) { | 144 void CaptivePortalBlockingPage::CommandReceived(const std::string& command) { |
145 // The response has quotes around it. | 145 // The response has quotes around it. |
146 if (command == std::string("\"") + kOpenLoginPageCommand + "\"") { | 146 if (command == std::string("\"") + kOpenLoginPageCommand + "\"") { |
147 RecordUMA(OPEN_LOGIN_PAGE); | 147 RecordUMA(OPEN_LOGIN_PAGE); |
148 CaptivePortalTabHelper::OpenLoginTabForWebContents(web_contents(), true); | 148 CaptivePortalTabHelper::OpenLoginTabForWebContents(web_contents(), true); |
149 } | 149 } |
150 } | 150 } |
OLD | NEW |