diff options
Diffstat (limited to 'chrome/browser/automation')
4 files changed, 0 insertions, 123 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 64c09a0..142fdbb 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -29,7 +29,6 @@ #include "chrome/browser/chromeos/login/login_status_consumer.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/login/wizard_controller.h" -#include "chrome/browser/chromeos/options/take_photo_dialog.h" #endif // defined(OS_CHROMEOS) #include "chrome/browser/common/cancelable_request.h" #include "chrome/browser/download/all_download_item_notifier.h" @@ -964,37 +963,6 @@ class EnrollmentObserver DISALLOW_COPY_AND_ASSIGN(EnrollmentObserver); }; -// Waits for profile photo to be captured by the camera, -// saved to file, and the path set in local state preferences -class PhotoCaptureObserver : public chromeos::TakePhotoDialog::Observer, - public chromeos::UserManager::Observer { - public: - PhotoCaptureObserver(AutomationProvider* automation, - IPC::Message* reply_message); - virtual ~PhotoCaptureObserver(); - - // TakePhotoDialog::Observer overrides - virtual void OnCaptureSuccess( - chromeos::TakePhotoDialog* dialog, - chromeos::TakePhotoView* take_photo_view) OVERRIDE; - virtual void OnCaptureFailure( - chromeos::TakePhotoDialog* dialog, - chromeos::TakePhotoView* take_photo_view) OVERRIDE; - virtual void OnCapturingStopped( - chromeos::TakePhotoDialog* dialog, - chromeos::TakePhotoView* take_photo_view) OVERRIDE; - - // UserManager::Observer overrides - virtual void LocalStateChanged( - chromeos::UserManager* user_manager) OVERRIDE; - - private: - base::WeakPtr<AutomationProvider> automation_; - scoped_ptr<IPC::Message> reply_message_; - - DISALLOW_COPY_AND_ASSIGN(PhotoCaptureObserver); -}; - #endif // defined(OS_CHROMEOS) // Waits for the bookmark model to load. diff --git a/chrome/browser/automation/automation_provider_observers_chromeos.cc b/chrome/browser/automation/automation_provider_observers_chromeos.cc index 02f036f..cb3f550 100644 --- a/chrome/browser/automation/automation_provider_observers_chromeos.cc +++ b/chrome/browser/automation/automation_provider_observers_chromeos.cc @@ -449,74 +449,3 @@ void EnrollmentObserver::OnEnrollmentComplete(bool succeeded) { } delete this; } - -PhotoCaptureObserver::PhotoCaptureObserver( - AutomationProvider* automation, - IPC::Message* reply_message) - : automation_(automation->AsWeakPtr()), - reply_message_(reply_message) { -} - -PhotoCaptureObserver::~PhotoCaptureObserver() { - // TODO(frankf): Currently, we do not destroy TakePhotoDialog - // or any of its children. -} - -void PhotoCaptureObserver::OnCaptureSuccess( - chromeos::TakePhotoDialog* take_photo_dialog, - chromeos::TakePhotoView* take_photo_view) { - take_photo_view->FlipCapturingState(); -} - -void PhotoCaptureObserver::OnCaptureFailure( - chromeos::TakePhotoDialog* take_photo_dialog, - chromeos::TakePhotoView* take_photo_view) { - if (automation_) { - AutomationJSONReply(automation_, - reply_message_.release()).SendError("Capture failure"); - } - delete this; -} - -void PhotoCaptureObserver::OnCapturingStopped( - chromeos::TakePhotoDialog* take_photo_dialog, - chromeos::TakePhotoView* take_photo_view) { - take_photo_dialog->Accept(); - const gfx::ImageSkia& photo = take_photo_view->GetImage(); - chromeos::UserManager* user_manager = chromeos::UserManager::Get(); - if (!user_manager) { - if (automation_) { - AutomationJSONReply( - automation_, - reply_message_.release()).SendError("No user manager"); - } - delete this; - return; - } - - const chromeos::User* user = user_manager->GetLoggedInUser(); - if (user->email().empty()) { - if (automation_) { - AutomationJSONReply( - automation_, - reply_message_.release()).SendError("User email is not set"); - } - delete this; - return; - } - - // Set up an observer for UserManager (it will delete itself). - user_manager->AddObserver(this); - user_manager->GetUserImageManager()->SaveUserImage( - user->email(), chromeos::UserImage::CreateAndEncode(photo)); -} - -void PhotoCaptureObserver::LocalStateChanged( - chromeos::UserManager* user_manager) { - user_manager->RemoveObserver(this); - if (automation_) { - AutomationJSONReply( - automation_, reply_message_.release()).SendSuccess(NULL); - } - delete this; -} diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 805e3ba..77d6528 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -1870,8 +1870,6 @@ void TestingAutomationProvider::BuildJSONHandlerMaps() { handler_map_["RefreshInternetDetails"] = &TestingAutomationProvider::RefreshInternetDetails; - browser_handler_map_["CaptureProfilePhoto"] = - &TestingAutomationProvider::CaptureProfilePhoto; browser_handler_map_["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; #endif // defined(OS_CHROMEOS) diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc index 087b1fe..98c9ab8 100644 --- a/chrome/browser/automation/testing_automation_provider_chromeos.cc +++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc @@ -33,7 +33,6 @@ #include "chrome/browser/chromeos/login/webui_login_display.h" #include "chrome/browser/chromeos/login/webui_login_display_host.h" #include "chrome/browser/chromeos/login/wizard_controller.h" -#include "chrome/browser/chromeos/options/take_photo_dialog.h" #include "chrome/browser/chromeos/proxy_config_service_impl.h" #include "chrome/browser/chromeos/proxy_cros_settings_parser.h" #include "chrome/browser/chromeos/settings/cros_settings.h" @@ -1488,23 +1487,6 @@ void TestingAutomationProvider::OpenCrosh(DictionaryValue* args, ash::Shell::GetInstance()->delegate()->OpenCrosh(); } -void TestingAutomationProvider::CaptureProfilePhoto( - Browser* browser, - DictionaryValue* args, - IPC::Message* reply_message) { - chromeos::TakePhotoDialog* take_photo_dialog = - new chromeos::TakePhotoDialog(NULL); - - // Set up an observer (it will delete itself). - take_photo_dialog->AddObserver(new PhotoCaptureObserver( - this, reply_message)); - - views::Widget* window = views::Widget::CreateWindowWithParent( - take_photo_dialog, browser->window()->GetNativeWindow()); - window->SetAlwaysOnTop(true); - window->Show(); -} - void TestingAutomationProvider::AddChromeosObservers() { power_manager_observer_ = new PowerManagerClientObserverForTesting; chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |