| 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/login/web_page_screen.h" | 5 #include "chrome/browser/chromeos/login/web_page_screen.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 | 8 |
| 9 using base::TimeDelta; | 9 using base::TimeDelta; |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // WebPageScreen, protected: | 43 // WebPageScreen, protected: |
| 44 | 44 |
| 45 void WebPageScreen::OnNetworkTimeout() { | 45 void WebPageScreen::OnNetworkTimeout() { |
| 46 // TODO(nkostylev): Add better detection for limited connectivity. | 46 // TODO(nkostylev): Add better detection for limited connectivity. |
| 47 // http://crosbug.com/3690 | 47 // http://crosbug.com/3690 |
| 48 CloseScreen(ScreenObserver::CONNECTION_FAILED); | 48 CloseScreen(ScreenObserver::CONNECTION_FAILED); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void WebPageScreen::StartTimeoutTimer() { | 51 void WebPageScreen::StartTimeoutTimer() { |
| 52 StopTimeoutTimer(); | 52 StopTimeoutTimer(); |
| 53 timeout_timer_.Start(FROM_HERE, | 53 timeout_timer_.Start(TimeDelta::FromSeconds(kNetworkTimeoutSec), |
| 54 TimeDelta::FromSeconds(kNetworkTimeoutSec), | |
| 55 this, | 54 this, |
| 56 &WebPageScreen::OnNetworkTimeout); | 55 &WebPageScreen::OnNetworkTimeout); |
| 57 } | 56 } |
| 58 | 57 |
| 59 void WebPageScreen::StopTimeoutTimer() { | 58 void WebPageScreen::StopTimeoutTimer() { |
| 60 if (timeout_timer_.IsRunning()) | 59 if (timeout_timer_.IsRunning()) |
| 61 timeout_timer_.Stop(); | 60 timeout_timer_.Stop(); |
| 62 } | 61 } |
| 63 | 62 |
| 64 } // namespace chromeos | 63 } // namespace chromeos |
| OLD | NEW |