Chromium Code Reviews| Index: chrome/browser/ssl/captive_portal_blocking_page.cc |
| diff --git a/chrome/browser/ssl/captive_portal_blocking_page.cc b/chrome/browser/ssl/captive_portal_blocking_page.cc |
| index 8c7138fcc70351ab652e8e5a189042bc6a1cc053..a3e98e6d927caae021e9440977a2431184866b62 100644 |
| --- a/chrome/browser/ssl/captive_portal_blocking_page.cc |
| +++ b/chrome/browser/ssl/captive_portal_blocking_page.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/i18n/rtl.h" |
| #include "base/metrics/histogram.h" |
| #include "base/prefs/pref_service.h" |
| +#include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/values.h" |
| @@ -34,8 +35,6 @@ enum CaptivePortalBlockingPageEvent { |
| CAPTIVE_PORTAL_BLOCKING_PAGE_EVENT_COUNT |
| }; |
| -const char kOpenLoginPageCommand[] = "openLoginPage"; |
| - |
| void RecordUMA(CaptivePortalBlockingPageEvent event) { |
| UMA_HISTOGRAM_ENUMERATION("interstitial.captive_portal", |
| event, |
| @@ -192,8 +191,11 @@ void CaptivePortalBlockingPage::PopulateInterstitialStrings( |
| } |
| void CaptivePortalBlockingPage::CommandReceived(const std::string& command) { |
| - // The response has quotes around it. |
| - if (command == std::string("\"") + kOpenLoginPageCommand + "\"") { |
| + int cmd = 0; |
| + bool retval = base::StringToInt(command, &cmd); |
|
meacer
2015/03/06 18:29:22
|command| has quotes around it (e.g. "1"), need to
meacer
2015/03/07 01:00:04
Correction: |command| shouldn't normally have quot
felt
2015/03/07 04:02:39
Done.
|
| + DCHECK(retval); |
| + |
| + if (cmd == CMD_OPEN_LOGIN) { |
| RecordUMA(OPEN_LOGIN_PAGE); |
| CaptivePortalTabHelper::OpenLoginTabForWebContents(web_contents(), true); |
| } |