OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/error_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 void ErrorScreenHandler::Show(OobeDisplay::Screen parent_screen, | 48 void ErrorScreenHandler::Show(OobeDisplay::Screen parent_screen, |
49 base::DictionaryValue* params) { | 49 base::DictionaryValue* params) { |
50 if (!page_is_ready()) { | 50 if (!page_is_ready()) { |
51 show_on_init_ = true; | 51 show_on_init_ = true; |
52 return; | 52 return; |
53 } | 53 } |
54 parent_screen_ = parent_screen; | 54 parent_screen_ = parent_screen; |
55 ShowScreen(OobeUI::kScreenErrorMessage, params); | 55 ShowScreen(OobeUI::kScreenErrorMessage, params); |
56 NetworkErrorShown(); | 56 NetworkErrorShown(); |
57 NetworkPortalDetector::Get()->EnableLazyDetection(); | 57 NetworkPortalDetector::Get()->EnableErrorScreenStrategy(); |
58 LOG(WARNING) << "Offline message is displayed"; | 58 LOG(WARNING) << "Offline message is displayed"; |
59 } | 59 } |
60 | 60 |
61 void ErrorScreenHandler::Hide() { | 61 void ErrorScreenHandler::Hide() { |
62 if (parent_screen_ == OobeUI::SCREEN_UNKNOWN) | 62 if (parent_screen_ == OobeUI::SCREEN_UNKNOWN) |
63 return; | 63 return; |
64 std::string screen_name; | 64 std::string screen_name; |
65 if (GetScreenName(parent_screen_, &screen_name)) | 65 if (GetScreenName(parent_screen_, &screen_name)) |
66 ShowScreen(screen_name.c_str(), NULL); | 66 ShowScreen(screen_name.c_str(), NULL); |
67 NetworkPortalDetector::Get()->DisableLazyDetection(); | 67 NetworkPortalDetector::Get()->DisableErrorScreenStrategy(); |
68 LOG(WARNING) << "Offline message is hidden"; | 68 LOG(WARNING) << "Offline message is hidden"; |
69 } | 69 } |
70 | 70 |
71 void ErrorScreenHandler::FixCaptivePortal() { | 71 void ErrorScreenHandler::FixCaptivePortal() { |
72 if (!captive_portal_window_proxy_.get()) { | 72 if (!captive_portal_window_proxy_.get()) { |
73 content::WebContents* web_contents = | 73 content::WebContents* web_contents = |
74 LoginDisplayHostImpl::default_host()->GetWebUILoginView()-> | 74 LoginDisplayHostImpl::default_host()->GetWebUILoginView()-> |
75 GetWebContents(); | 75 GetWebContents(); |
76 captive_portal_window_proxy_.reset( | 76 captive_portal_window_proxy_.reset( |
77 new CaptivePortalWindowProxy(network_state_informer_.get(), | 77 new CaptivePortalWindowProxy(network_state_informer_.get(), |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 params.SetInteger("errorState", static_cast<int>(error_state_)); | 221 params.SetInteger("errorState", static_cast<int>(error_state_)); |
222 params.SetString("network", network_); | 222 params.SetString("network", network_); |
223 params.SetBoolean("guestSigninAllowed", guest_signin_allowed_); | 223 params.SetBoolean("guestSigninAllowed", guest_signin_allowed_); |
224 params.SetBoolean("offlineLoginAllowed", offline_login_allowed_); | 224 params.SetBoolean("offlineLoginAllowed", offline_login_allowed_); |
225 Show(parent_screen_, ¶ms); | 225 Show(parent_screen_, ¶ms); |
226 show_on_init_ = false; | 226 show_on_init_ = false; |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |