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

Unified Diff: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc

Issue 220693003: [oobe] Postpone localized content reload till WebUI is ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_screen_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
index 30d2e1f02211925f6037bda19cd6eda618f96653..7d0f5111014d29b711ad60224647e96cb87d2cd1 100644
--- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
@@ -84,6 +84,7 @@ NetworkScreenHandler::NetworkScreenHandler(CoreOobeActor* core_oobe_actor)
core_oobe_actor_(core_oobe_actor),
is_continue_enabled_(false),
show_on_init_(false),
+ should_reinitialize_language_keyboard_list_(false),
weak_ptr_factory_(this) {
DCHECK(core_oobe_actor_);
SetupTimeouts();
@@ -144,13 +145,6 @@ void NetworkScreenHandler::ClearErrors() {
void NetworkScreenHandler::ShowConnectingStatus(
bool connecting,
const base::string16& network_id) {
- // base::string16 connecting_label =
- // l10n_util::GetStringFUTF16(IDS_NETWORK_SELECTION_CONNECTING,
- // network_id);
- // CallJS("cr.ui.Oobe.showConnectingStatus",
- // base::FundamentalValue(connecting),
- // base::StringValue(network_id),
- // base::StringValue(connecting_label_value));
}
void NetworkScreenHandler::EnableContinue(bool enabled) {
@@ -193,6 +187,11 @@ void NetworkScreenHandler::Initialize() {
Show();
}
+ if (should_reinitialize_language_keyboard_list_) {
+ should_reinitialize_language_keyboard_list_ = false;
+ ReloadLocalizedContent();
+ }
+
timezone_subscription_ = CrosSettings::Get()->AddSettingsObserver(
kSystemTimezone,
base::Bind(&NetworkScreenHandler::OnSystemTimezoneChanged,
@@ -248,14 +247,7 @@ void NetworkScreenHandler::OnLanguageChangedCallback(
return;
NetworkScreenHandler* const self = context->handler_.get();
-
- base::DictionaryValue localized_strings;
- static_cast<OobeUI*>(self->web_ui()->GetController())
- ->GetLocalizedStrings(&localized_strings);
- self->core_oobe_actor_->ReloadContent(localized_strings);
-
- // Buttons are recreated, updated "Continue" button state.
- self->EnableContinue(self->is_continue_enabled_);
+ self->ReloadLocalizedContent();
AccessibilityManager::Get()->OnLocaleChanged();
}
@@ -448,11 +440,20 @@ void NetworkScreenHandler::OnImeComponentExtensionInitialized() {
// Refreshes the language and keyboard list once the component extension
// IMEs are initialized.
+ if (page_is_ready())
+ ReloadLocalizedContent();
+ else
+ should_reinitialize_language_keyboard_list_ = true;
+}
+
+void NetworkScreenHandler::ReloadLocalizedContent() {
base::DictionaryValue localized_strings;
- static_cast<OobeUI*>(this->web_ui()->GetController())
+ static_cast<OobeUI*>(web_ui()->GetController())
->GetLocalizedStrings(&localized_strings);
- this->core_oobe_actor_->ReloadContent(localized_strings);
- this->EnableContinue(this->is_continue_enabled_);
+ core_oobe_actor_->ReloadContent(localized_strings);
+
+ // Buttons are recreated, updated "Continue" button state.
+ EnableContinue(is_continue_enabled_);
}
// static
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698