Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1558)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc

Issue 183973029: Refactoring of the NetworkPortalDetector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_, &params); 225 Show(parent_screen_, &params);
226 show_on_init_ = false; 226 show_on_init_ = false;
227 } 227 }
228 } 228 }
229 229
230 } // namespace chromeos 230 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/network_portal_detector_test_impl.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698