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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 933 g_browser_process->browser_policy_connector(); | 933 g_browser_process->browser_policy_connector(); |
| 934 if (!connector) { | 934 if (!connector) { |
| 935 reply.SendError("Unable to access BrowserPolicyConnector"); | 935 reply.SendError("Unable to access BrowserPolicyConnector"); |
| 936 return; | 936 return; |
| 937 } | 937 } |
| 938 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 938 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
| 939 return_value->SetBoolean("enterprise", connector->IsEnterpriseManaged()); | 939 return_value->SetBoolean("enterprise", connector->IsEnterpriseManaged()); |
| 940 reply.SendSuccess(return_value.get()); | 940 reply.SendSuccess(return_value.get()); |
| 941 } | 941 } |
| 942 | 942 |
| 943 void TestingAutomationProvider::FetchEnterprisePolicy( | 943 void TestingAutomationProvider::FetchEnterprisePolicy( |
|
Mattias Nissler (ping if slow)
2011/11/18 11:00:25
Wouldn't this now be covered by a regular refresh?
Joao da Silva
2011/11/18 14:03:30
Yes. I'll update the CloudPolicyObserver in the au
| |
| 944 DictionaryValue* args, IPC::Message* reply_message) { | 944 DictionaryValue* args, IPC::Message* reply_message) { |
| 945 policy::BrowserPolicyConnector* connector = | 945 policy::BrowserPolicyConnector* connector = |
| 946 g_browser_process->browser_policy_connector(); | 946 g_browser_process->browser_policy_connector(); |
| 947 if (!connector) { | 947 if (!connector) { |
| 948 AutomationJSONReply(this, reply_message).SendError( | 948 AutomationJSONReply(this, reply_message).SendError( |
| 949 "Unable to access BrowserPolicyConnector"); | 949 "Unable to access BrowserPolicyConnector"); |
| 950 return; | 950 return; |
| 951 } | 951 } |
| 952 policy::CloudPolicySubsystem* policy_subsystem = | 952 policy::CloudPolicySubsystem* policy_subsystem = |
| 953 connector->user_cloud_policy_subsystem(); | 953 connector->user_cloud_policy_subsystem(); |
| 954 if (policy_subsystem) { | 954 if (policy_subsystem) { |
| 955 // Set up an observer (it will delete itself). | 955 // Set up an observer (it will delete itself). |
| 956 new CloudPolicyObserver(this, reply_message, connector, policy_subsystem); | 956 new CloudPolicyObserver(this, reply_message, connector, policy_subsystem); |
| 957 connector->FetchDevicePolicy(); | 957 connector->FetchCloudPolicy(); |
| 958 } else { | 958 } else { |
| 959 AutomationJSONReply(this, reply_message).SendError( | 959 AutomationJSONReply(this, reply_message).SendError( |
| 960 "Unable to access CloudPolicySubsystem"); | 960 "Unable to access CloudPolicySubsystem"); |
| 961 } | 961 } |
| 962 } | 962 } |
| 963 | 963 |
| 964 void TestingAutomationProvider::EnrollEnterpriseDevice( | 964 void TestingAutomationProvider::EnrollEnterpriseDevice( |
| 965 DictionaryValue* args, IPC::Message* reply_message) { | 965 DictionaryValue* args, IPC::Message* reply_message) { |
| 966 std::string user, password; | 966 std::string user, password; |
| 967 if (!args->GetString("user", &user) || | 967 if (!args->GetString("user", &user) || |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1204 views::Widget* window = browser::CreateViewsWindow( | 1204 views::Widget* window = browser::CreateViewsWindow( |
| 1205 browser->window()->GetNativeHandle(), take_photo_dialog); | 1205 browser->window()->GetNativeHandle(), take_photo_dialog); |
| 1206 window->SetAlwaysOnTop(true); | 1206 window->SetAlwaysOnTop(true); |
| 1207 window->Show(); | 1207 window->Show(); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void TestingAutomationProvider::PowerChanged( | 1210 void TestingAutomationProvider::PowerChanged( |
| 1211 const chromeos::PowerSupplyStatus& status) { | 1211 const chromeos::PowerSupplyStatus& status) { |
| 1212 power_status = status; | 1212 power_status = status; |
| 1213 } | 1213 } |
| OLD | NEW |