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

Unified 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: Addressed all the comments Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider_chromeos.cc
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc
index f6c888e76bcdcf232711f98f4f70b52bc08ebf7b..eabc6e7043ff017633a080f3e3775cab4c599e66 100644
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc
@@ -22,13 +22,17 @@
#include "chrome/browser/chromeos/login/screen_locker.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/network_state_notifier.h"
+#include "chrome/browser/chromeos/options/take_photo_dialog.h"
#include "chrome/browser/chromeos/proxy_cros_settings_provider.h"
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/policy/cloud_policy_cache_base.h"
#include "chrome/browser/policy/cloud_policy_data_store.h"
#include "chrome/browser/policy/cloud_policy_subsystem.h"
#include "chrome/browser/policy/enterprise_install_attributes.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/views/window.h"
#include "policy/policy_constants.h"
+#include "views/widget/widget.h"
using chromeos::CrosLibrary;
using chromeos::NetworkLibrary;
@@ -1001,3 +1005,20 @@ void TestingAutomationProvider::SetMute(DictionaryValue* args,
audio_handler->SetMuted(mute);
reply.SendSuccess(NULL);
}
+
+void TestingAutomationProvider::CaptureProfilePhoto(
+ Browser* browser,
+ DictionaryValue* args,
+ IPC::Message* reply_message) {
+ chromeos::TakePhotoDialog* take_photo_dialog =
+ 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
+
+ // Set up an observer (it will delete itself).
+ take_photo_dialog->AddObserver(new PhotoCaptureObserver(
+ this, reply_message));
+
+ views::Widget* window = browser::CreateViewsWindow(
+ browser->window()->GetNativeHandle(), take_photo_dialog);
+ window->SetAlwaysOnTop(true);
+ window->Show();
+}

Powered by Google App Engine
This is Rietveld 408576698