OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 frame_state_ = FRAME_STATE_LOADING; | 175 frame_state_ = FRAME_STATE_LOADING; |
176 CallJS("loadAuthExtension", params); | 176 CallJS("loadAuthExtension", params); |
177 } | 177 } |
178 | 178 |
179 void GaiaScreenHandler::UpdateGaia(const GaiaContext& context) { | 179 void GaiaScreenHandler::UpdateGaia(const GaiaContext& context) { |
180 base::DictionaryValue params; | 180 base::DictionaryValue params; |
181 UpdateAuthParams(¶ms, context.has_users); | 181 UpdateAuthParams(¶ms, context.has_users); |
182 CallJS("updateAuthExtension", params); | 182 CallJS("updateAuthExtension", params); |
183 } | 183 } |
184 | 184 |
185 void GaiaScreenHandler::ReloadGaia() { | 185 void GaiaScreenHandler::ReloadGaia(bool force_reload) { |
186 if (frame_state_ == FRAME_STATE_LOADING) | 186 if (frame_state_ == FRAME_STATE_LOADING && !force_reload) { |
| 187 VLOG(1) << "Skipping reloading of Gaia since gaia is loading."; |
187 return; | 188 return; |
| 189 } |
188 NetworkStateInformer::State state = network_state_informer_->state(); | 190 NetworkStateInformer::State state = network_state_informer_->state(); |
189 if (state != NetworkStateInformer::ONLINE) { | 191 if (state != NetworkStateInformer::ONLINE) { |
190 VLOG(1) << "Skipping reloading of Gaia since network state=" | 192 VLOG(1) << "Skipping reloading of Gaia since network state=" |
191 << NetworkStateInformer::StatusString(state); | 193 << NetworkStateInformer::StatusString(state); |
192 return; | 194 return; |
193 } | 195 } |
194 VLOG(1) << "Reloading Gaia."; | 196 VLOG(1) << "Reloading Gaia."; |
195 frame_state_ = FRAME_STATE_LOADING; | 197 frame_state_ = FRAME_STATE_LOADING; |
196 CallJS("doReload"); | 198 CallJS("doReload"); |
197 } | 199 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 540 |
539 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 541 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
540 DCHECK(signin_screen_handler_); | 542 DCHECK(signin_screen_handler_); |
541 return signin_screen_handler_->delegate_; | 543 return signin_screen_handler_->delegate_; |
542 } | 544 } |
543 | 545 |
544 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 546 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
545 signin_screen_handler_ = handler; | 547 signin_screen_handler_ = handler; |
546 } | 548 } |
547 } // namespace chromeos | 549 } // namespace chromeos |
OLD | NEW |