| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/automation/automation_provider_json.h" | 11 #include "chrome/browser/automation/automation_provider_json.h" |
| 12 #include "chrome/browser/automation/automation_provider_observers.h" | 12 #include "chrome/browser/automation/automation_provider_observers.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chromeos/audio_handler.h" | 14 #include "chrome/browser/chromeos/audio_handler.h" |
| 15 #include "chrome/browser/chromeos/cros/cros_library.h" | 15 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 16 #include "chrome/browser/chromeos/cros/network_library.h" | 16 #include "chrome/browser/chromeos/cros/network_library.h" |
| 17 #include "chrome/browser/chromeos/cros/power_library.h" | 17 #include "chrome/browser/chromeos/cros/power_library.h" |
| 18 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 18 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 19 #include "chrome/browser/chromeos/cros/update_library.h" | 19 #include "chrome/browser/chromeos/cros/update_library.h" |
| 20 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" | 20 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" |
| 21 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 21 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 22 #include "chrome/browser/chromeos/login/login_display.h" | 22 #include "chrome/browser/chromeos/login/login_display.h" |
| 23 #include "chrome/browser/chromeos/login/login_display_host.h" | 23 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 24 #include "chrome/browser/chromeos/login/screen_locker.h" | 24 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 25 #include "chrome/browser/chromeos/login/wizard_controller.h" | 25 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 26 #include "chrome/browser/chromeos/network_state_notifier.h" | 26 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 27 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 27 #include "chrome/browser/chromeos/proxy_cros_settings_provider.h" | 28 #include "chrome/browser/chromeos/proxy_cros_settings_provider.h" |
| 28 #include "chrome/browser/chromeos/system/timezone_settings.h" | 29 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 29 #include "chrome/browser/policy/browser_policy_connector.h" | 30 #include "chrome/browser/policy/browser_policy_connector.h" |
| 30 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 31 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 31 #include "chrome/browser/policy/cloud_policy_data_store.h" | 32 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 32 #include "chrome/browser/policy/cloud_policy_subsystem.h" | 33 #include "chrome/browser/policy/cloud_policy_subsystem.h" |
| 33 #include "chrome/browser/policy/enterprise_install_attributes.h" | 34 #include "chrome/browser/policy/enterprise_install_attributes.h" |
| 34 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
| 36 #include "chrome/browser/ui/browser_window.h" |
| 37 #include "chrome/browser/ui/views/window.h" |
| 35 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 36 #include "policy/policy_constants.h" | 39 #include "policy/policy_constants.h" |
| 40 #include "views/widget/widget.h" |
| 37 | 41 |
| 38 using chromeos::CrosLibrary; | 42 using chromeos::CrosLibrary; |
| 39 using chromeos::NetworkLibrary; | 43 using chromeos::NetworkLibrary; |
| 40 using chromeos::UserManager; | 44 using chromeos::UserManager; |
| 41 using chromeos::UpdateLibrary; | 45 using chromeos::UpdateLibrary; |
| 42 | 46 |
| 43 namespace { | 47 namespace { |
| 44 | 48 |
| 45 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, | 49 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, |
| 46 IPC::Message* reply_message) { | 50 IPC::Message* reply_message) { |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 bool mute; | 1083 bool mute; |
| 1080 if (!args->GetBoolean("mute", &mute)) { | 1084 if (!args->GetBoolean("mute", &mute)) { |
| 1081 reply.SendError("Invalid or missing args."); | 1085 reply.SendError("Invalid or missing args."); |
| 1082 return; | 1086 return; |
| 1083 } | 1087 } |
| 1084 | 1088 |
| 1085 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance(); | 1089 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance(); |
| 1086 audio_handler->SetMuted(mute); | 1090 audio_handler->SetMuted(mute); |
| 1087 reply.SendSuccess(NULL); | 1091 reply.SendSuccess(NULL); |
| 1088 } | 1092 } |
| 1093 |
| 1094 void TestingAutomationProvider::CaptureProfilePhoto( |
| 1095 Browser* browser, |
| 1096 DictionaryValue* args, |
| 1097 IPC::Message* reply_message) { |
| 1098 chromeos::TakePhotoDialog* take_photo_dialog = |
| 1099 new chromeos::TakePhotoDialog(NULL); |
| 1100 |
| 1101 // Set up an observer (it will delete itself). |
| 1102 take_photo_dialog->AddObserver(new PhotoCaptureObserver( |
| 1103 this, reply_message)); |
| 1104 |
| 1105 views::Widget* window = browser::CreateViewsWindow( |
| 1106 browser->window()->GetNativeHandle(), take_photo_dialog); |
| 1107 window->SetAlwaysOnTop(true); |
| 1108 window->Show(); |
| 1109 } |
| OLD | NEW |