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/core_oobe_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 localized_strings->SetString("highContrastOption", | 67 localized_strings->SetString("highContrastOption", |
68 l10n_util::GetStringUTF16(IDS_OOBE_HIGH_CONTRAST_MODE_OPTION)); | 68 l10n_util::GetStringUTF16(IDS_OOBE_HIGH_CONTRAST_MODE_OPTION)); |
69 localized_strings->SetString("screenMagnifierOption", | 69 localized_strings->SetString("screenMagnifierOption", |
70 l10n_util::GetStringUTF16(IDS_OOBE_SCREEN_MAGNIFIER_OPTION)); | 70 l10n_util::GetStringUTF16(IDS_OOBE_SCREEN_MAGNIFIER_OPTION)); |
71 | 71 |
72 // TODO(nkostylev): Move OOBE/login WebUI from localStrings to loadTimeData. | 72 // TODO(nkostylev): Move OOBE/login WebUI from localStrings to loadTimeData. |
73 if (chromeos::accessibility::IsHighContrastEnabled()) | 73 if (chromeos::accessibility::IsHighContrastEnabled()) |
74 localized_strings->SetString("highContrastEnabled", "on"); | 74 localized_strings->SetString("highContrastEnabled", "on"); |
75 if (chromeos::accessibility::IsSpokenFeedbackEnabled()) | 75 if (chromeos::accessibility::IsSpokenFeedbackEnabled()) |
76 localized_strings->SetString("spokenFeedbackEnabled", "on"); | 76 localized_strings->SetString("spokenFeedbackEnabled", "on"); |
77 if (chromeos::accessibility::GetScreenMagnifierType() != | 77 if (chromeos::accessibility::GetMagnifierType() != |
78 chromeos::accessibility::MAGNIFIER_OFF) { | 78 ash::MAGNIFIER_OFF) { |
79 localized_strings->SetString("screenMagnifierEnabled", "on"); | 79 localized_strings->SetString("screenMagnifierEnabled", "on"); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void CoreOobeHandler::Initialize() { | 83 void CoreOobeHandler::Initialize() { |
84 UpdateOobeUIVisibility(); | 84 UpdateOobeUIVisibility(); |
85 #if defined(OFFICIAL_BUILD) | 85 #if defined(OFFICIAL_BUILD) |
86 version_info_updater_.StartUpdate(true); | 86 version_info_updater_.StartUpdate(true); |
87 #else | 87 #else |
88 version_info_updater_.StartUpdate(false); | 88 version_info_updater_.StartUpdate(false); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 chromeos::accessibility::EnableHighContrast(enabled); | 139 chromeos::accessibility::EnableHighContrast(enabled); |
140 } | 140 } |
141 | 141 |
142 void CoreOobeHandler::HandleEnableScreenMagnifier(const base::ListValue* args) { | 142 void CoreOobeHandler::HandleEnableScreenMagnifier(const base::ListValue* args) { |
143 bool enabled; | 143 bool enabled; |
144 if (!args->GetBoolean(0, &enabled)) { | 144 if (!args->GetBoolean(0, &enabled)) { |
145 NOTREACHED(); | 145 NOTREACHED(); |
146 return; | 146 return; |
147 } | 147 } |
148 // TODO(nkostylev): Add support for partial screen magnifier. | 148 // TODO(nkostylev): Add support for partial screen magnifier. |
149 chromeos::accessibility::ScreenMagnifierType type = enabled ? | 149 ash::MagnifierType type = enabled ? ash::MAGNIFIER_FULL : |
150 chromeos::accessibility::MAGNIFIER_FULL : | 150 ash::MAGNIFIER_OFF; |
151 chromeos::accessibility::MAGNIFIER_OFF; | 151 chromeos::accessibility::SetMagnifier(type); |
152 chromeos::accessibility::SetScreenMagnifier(type); | |
153 } | 152 } |
154 | 153 |
155 void CoreOobeHandler::HandleEnableSpokenFeedback(const base::ListValue* args) { | 154 void CoreOobeHandler::HandleEnableSpokenFeedback(const base::ListValue* args) { |
156 // Checkbox is initialized on page init and updates when spoken feedback | 155 // Checkbox is initialized on page init and updates when spoken feedback |
157 // setting is changed so just toggle spoken feedback here. | 156 // setting is changed so just toggle spoken feedback here. |
158 chromeos::accessibility::ToggleSpokenFeedback(web_ui()); | 157 chromeos::accessibility::ToggleSpokenFeedback(web_ui()); |
159 } | 158 } |
160 | 159 |
161 void CoreOobeHandler::ShowOobeUI(bool show) { | 160 void CoreOobeHandler::ShowOobeUI(bool show) { |
162 if (show == show_oobe_ui_) | 161 if (show == show_oobe_ui_) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 const std::string& text) { | 205 const std::string& text) { |
207 base::StringValue id_value(UTF8ToUTF16(id)); | 206 base::StringValue id_value(UTF8ToUTF16(id)); |
208 base::StringValue text_value(UTF8ToUTF16(text)); | 207 base::StringValue text_value(UTF8ToUTF16(text)); |
209 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setLabelText", | 208 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setLabelText", |
210 id_value, | 209 id_value, |
211 text_value); | 210 text_value); |
212 } | 211 } |
213 | 212 |
214 } // namespace chromeos | 213 } // namespace chromeos |
215 | 214 |
OLD | NEW |