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

Side by Side Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 7523063: Add a hook for capturing a user profile photo and saving it to file and local state. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
dennis_jeffrey 2011/07/29 20:10:06 remove this blank line
frankf 2011/07/29 21:50:40 Done.
1014 chromeos::TakePhotoDialog* take_photo_dialog =
1015 new chromeos::TakePhotoDialog(NULL);
1016
1017 // Set up an observer (it will delete itself).
1018 take_photo_dialog->AddObserver(new PhotoCaptureObserver(
1019 this, reply_message));
1020
1021 views::Widget* window = browser::CreateViewsWindow(
1022 browser->window()->GetNativeHandle(),
1023 take_photo_dialog);
dennis_jeffrey 2011/07/29 20:10:06 fit this on the previous line
frankf 2011/07/29 21:50:40 Done.
1024 window->SetAlwaysOnTop(true);
1025 window->Show();
1026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698