| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/enable_debugging_screen_handler
.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler
.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" | 14 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 16 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/grit/chromium_strings.h" | 18 #include "chrome/grit/chromium_strings.h" |
| 19 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 20 #include "chromeos/chromeos_switches.h" | 20 #include "chromeos/chromeos_switches.h" |
| 21 #include "chromeos/dbus/cryptohome_client.h" | 21 #include "chromeos/dbus/cryptohome_client.h" |
| 22 #include "chromeos/dbus/dbus_thread_manager.h" | 22 #include "chromeos/dbus/dbus_thread_manager.h" |
| 23 #include "chromeos/dbus/debug_daemon_client.h" | 23 #include "chromeos/dbus/debug_daemon_client.h" |
| 24 #include "chromeos/dbus/power_manager_client.h" | 24 #include "chromeos/dbus/power_manager_client.h" |
| 25 #include "components/login/localized_values_builder.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| 29 const char kJsScreenPath[] = "login.EnableDebuggingScreen"; | 30 const char kJsScreenPath[] = "login.EnableDebuggingScreen"; |
| 30 | 31 |
| 31 const char kEnableDebuggingScreen[] = "debugging"; | 32 const char kEnableDebuggingScreen[] = "debugging"; |
| 32 | 33 |
| 33 } // namespace | 34 } // namespace |
| 34 | 35 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 weak_ptr_factory_.InvalidateWeakPtrs(); | 78 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void EnableDebuggingScreenHandler::SetDelegate(Delegate* delegate) { | 81 void EnableDebuggingScreenHandler::SetDelegate(Delegate* delegate) { |
| 81 delegate_ = delegate; | 82 delegate_ = delegate; |
| 82 if (page_is_ready()) | 83 if (page_is_ready()) |
| 83 Initialize(); | 84 Initialize(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void EnableDebuggingScreenHandler::DeclareLocalizedValues( | 87 void EnableDebuggingScreenHandler::DeclareLocalizedValues( |
| 87 LocalizedValuesBuilder* builder) { | 88 ::login::LocalizedValuesBuilder* builder) { |
| 88 builder->Add("enableDebuggingScreenTitle", | 89 builder->Add("enableDebuggingScreenTitle", |
| 89 IDS_ENABLE_DEBUGGING_SCREEN_TITLE); | 90 IDS_ENABLE_DEBUGGING_SCREEN_TITLE); |
| 90 builder->Add("enableDebuggingScreenAccessibleTitle", | 91 builder->Add("enableDebuggingScreenAccessibleTitle", |
| 91 IDS_ENABLE_DEBUGGING_SCREEN_TITLE); | 92 IDS_ENABLE_DEBUGGING_SCREEN_TITLE); |
| 92 builder->Add("enableDebuggingCancelButton", IDS_CANCEL); | 93 builder->Add("enableDebuggingCancelButton", IDS_CANCEL); |
| 93 builder->Add("enableDebuggingOKButton", IDS_OK); | 94 builder->Add("enableDebuggingOKButton", IDS_OK); |
| 94 builder->Add("enableDebuggingRemoveButton", | 95 builder->Add("enableDebuggingRemoveButton", |
| 95 IDS_ENABLE_DEBUGGING_REMOVE_ROOTFS_BUTTON); | 96 IDS_ENABLE_DEBUGGING_REMOVE_ROOTFS_BUTTON); |
| 96 builder->Add("enableDebuggingEnableButton", | 97 builder->Add("enableDebuggingEnableButton", |
| 97 IDS_ENABLE_DEBUGGING_ENABLE_BUTTON); | 98 IDS_ENABLE_DEBUGGING_ENABLE_BUTTON); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 LoginWebDialog* dialog = new LoginWebDialog( | 287 LoginWebDialog* dialog = new LoginWebDialog( |
| 287 Profile::FromWebUI(web_ui()), | 288 Profile::FromWebUI(web_ui()), |
| 288 NULL, | 289 NULL, |
| 289 GetNativeWindow(), | 290 GetNativeWindow(), |
| 290 base::string16(), | 291 base::string16(), |
| 291 data_url); | 292 data_url); |
| 292 dialog->Show(); | 293 dialog->Show(); |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace chromeos | 296 } // namespace chromeos |
| OLD | NEW |