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

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

Issue 1086563003: Fix SEGV in ErrorScreenHandler::HandleHideCaptivePortal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "chrome/browser/chromeos/login/screens/network_error_model.h" 9 #include "chrome/browser/chromeos/login/screens/network_error_model.h"
10 #include "chrome/grit/chromium_strings.h" 10 #include "chrome/grit/chromium_strings.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool ErrorScreenHandler::GetScreenName(OobeUI::Screen screen, 69 bool ErrorScreenHandler::GetScreenName(OobeUI::Screen screen,
70 std::string* name) const { 70 std::string* name) const {
71 OobeUI* oobe_ui = static_cast<OobeUI*>(web_ui()->GetController()); 71 OobeUI* oobe_ui = static_cast<OobeUI*>(web_ui()->GetController());
72 if (!oobe_ui) 72 if (!oobe_ui)
73 return false; 73 return false;
74 *name = oobe_ui->GetScreenName(screen); 74 *name = oobe_ui->GetScreenName(screen);
75 return true; 75 return true;
76 } 76 }
77 77
78 void ErrorScreenHandler::HandleHideCaptivePortal() { 78 void ErrorScreenHandler::HandleHideCaptivePortal() {
79 model_->HideCaptivePortal(); 79 if (model_)
80 model_->HideCaptivePortal();
80 } 81 }
81 82
82 void ErrorScreenHandler::RegisterMessages() { 83 void ErrorScreenHandler::RegisterMessages() {
83 AddCallback("hideCaptivePortal", 84 AddCallback("hideCaptivePortal",
84 &ErrorScreenHandler::HandleHideCaptivePortal); 85 &ErrorScreenHandler::HandleHideCaptivePortal);
85 BaseScreenHandler::RegisterMessages(); 86 BaseScreenHandler::RegisterMessages();
86 } 87 }
87 88
88 void ErrorScreenHandler::DeclareLocalizedValues( 89 void ErrorScreenHandler::DeclareLocalizedValues(
89 ::login::LocalizedValuesBuilder* builder) { 90 ::login::LocalizedValuesBuilder* builder) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return; 127 return;
127 128
128 if (show_on_init_) { 129 if (show_on_init_) {
129 // TODO(nkostylev): Check that context initial state is properly passed. 130 // TODO(nkostylev): Check that context initial state is properly passed.
130 Show(); 131 Show();
131 show_on_init_ = false; 132 show_on_init_ = false;
132 } 133 }
133 } 134 }
134 135
135 } // namespace chromeos 136 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698