Chromium Code Reviews| 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/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/automation/automation_provider_json.h" | 9 #include "chrome/browser/automation/automation_provider_json.h" |
| 10 #include "chrome/browser/automation/automation_provider_observers.h" | 10 #include "chrome/browser/automation/automation_provider_observers.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/chromeos/audio_handler.h" | 12 #include "chrome/browser/chromeos/audio_handler.h" |
| 13 #include "chrome/browser/chromeos/cros/cros_library.h" | 13 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 14 #include "chrome/browser/chromeos/cros/network_library.h" | 14 #include "chrome/browser/chromeos/cros/network_library.h" |
| 15 #include "chrome/browser/chromeos/cros/power_library.h" | 15 #include "chrome/browser/chromeos/cros/power_library.h" |
| 16 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 16 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 17 #include "chrome/browser/chromeos/cros/update_library.h" | 17 #include "chrome/browser/chromeos/cros/update_library.h" |
| 18 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" | 18 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" |
| 19 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 19 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 20 #include "chrome/browser/chromeos/login/login_display.h" | 20 #include "chrome/browser/chromeos/login/login_display.h" |
| 21 #include "chrome/browser/chromeos/login/login_display_host.h" | 21 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 22 #include "chrome/browser/chromeos/login/screen_locker.h" | 22 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 23 #include "chrome/browser/chromeos/login/wizard_controller.h" | 23 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 24 #include "chrome/browser/chromeos/network_state_notifier.h" | 24 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 25 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | |
| 25 #include "chrome/browser/chromeos/proxy_cros_settings_provider.h" | 26 #include "chrome/browser/chromeos/proxy_cros_settings_provider.h" |
| 26 #include "chrome/browser/policy/browser_policy_connector.h" | 27 #include "chrome/browser/policy/browser_policy_connector.h" |
| 27 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 28 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 28 #include "chrome/browser/policy/cloud_policy_data_store.h" | 29 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 29 #include "chrome/browser/policy/cloud_policy_subsystem.h" | 30 #include "chrome/browser/policy/cloud_policy_subsystem.h" |
| 30 #include "chrome/browser/policy/enterprise_install_attributes.h" | 31 #include "chrome/browser/policy/enterprise_install_attributes.h" |
| 32 #include "chrome/browser/ui/browser_window.h" | |
| 33 #include "chrome/browser/ui/views/window.h" | |
| 31 #include "policy/policy_constants.h" | 34 #include "policy/policy_constants.h" |
| 35 #include "views/widget/widget.h" | |
| 32 | 36 |
| 33 using chromeos::CrosLibrary; | 37 using chromeos::CrosLibrary; |
| 34 using chromeos::NetworkLibrary; | 38 using chromeos::NetworkLibrary; |
| 35 using chromeos::UserManager; | 39 using chromeos::UserManager; |
| 36 using chromeos::UpdateLibrary; | 40 using chromeos::UpdateLibrary; |
| 37 | 41 |
| 38 namespace { | 42 namespace { |
| 39 | 43 |
| 40 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, | 44 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, |
| 41 IPC::Message* reply_message) { | 45 IPC::Message* reply_message) { |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 994 bool mute; | 998 bool mute; |
| 995 if (!args->GetBoolean("mute", &mute)) { | 999 if (!args->GetBoolean("mute", &mute)) { |
| 996 reply.SendError("Invalid or missing args."); | 1000 reply.SendError("Invalid or missing args."); |
| 997 return; | 1001 return; |
| 998 } | 1002 } |
| 999 | 1003 |
| 1000 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance(); | 1004 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance(); |
| 1001 audio_handler->SetMuted(mute); | 1005 audio_handler->SetMuted(mute); |
| 1002 reply.SendSuccess(NULL); | 1006 reply.SendSuccess(NULL); |
| 1003 } | 1007 } |
| 1008 | |
| 1009 void TestingAutomationProvider::CaptureProfilePhoto( | |
| 1010 Browser* browser, | |
| 1011 DictionaryValue* args, | |
| 1012 IPC::Message* reply_message) { | |
| 1013 chromeos::TakePhotoDialog* take_photo_dialog = | |
| 1014 new chromeos::TakePhotoDialog(NULL); | |
|
Nirnimesh
2011/07/30 10:32:31
who deletes this object?
frankf
2011/08/01 19:31:09
The UI is not destroyed (This is documented in the
| |
| 1015 | |
| 1016 // Set up an observer (it will delete itself). | |
| 1017 take_photo_dialog->AddObserver(new PhotoCaptureObserver( | |
| 1018 this, reply_message)); | |
| 1019 | |
| 1020 views::Widget* window = browser::CreateViewsWindow( | |
| 1021 browser->window()->GetNativeHandle(), take_photo_dialog); | |
| 1022 window->SetAlwaysOnTop(true); | |
| 1023 window->Show(); | |
| 1024 } | |
| OLD | NEW |