summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/login/enrollment/enrollment_screen.cc6
-rw-r--r--components/pairing/bluetooth_host_pairing_controller.cc7
-rw-r--r--components/pairing/bluetooth_host_pairing_controller.h2
-rw-r--r--components/pairing/fake_host_pairing_controller.cc4
-rw-r--r--components/pairing/fake_host_pairing_controller.h1
-rw-r--r--components/pairing/host_pairing_controller.h3
-rw-r--r--components/pairing/pairing_api.proto1
7 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
index 8e6c4f4..385226f 100644
--- a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
+++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
@@ -243,6 +243,12 @@ void EnrollmentScreen::OnDeviceAttributeUpdatePermission(bool granted) {
}
if (remora_controller_) {
+ policy::BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()->browser_policy_connector_chromeos();
+ const enterprise_management::PolicyData* policy =
+ connector->GetDeviceCloudPolicyManager()->core()->store()->policy();
+
+ remora_controller_->SetPermanentId(policy->directory_api_id());
remora_controller_->OnEnrollmentStatusChanged(
HostPairingController::ENROLLMENT_STATUS_SUCCESS);
}
diff --git a/components/pairing/bluetooth_host_pairing_controller.cc b/components/pairing/bluetooth_host_pairing_controller.cc
index 580d92f..c8246b1 100644
--- a/components/pairing/bluetooth_host_pairing_controller.cc
+++ b/components/pairing/bluetooth_host_pairing_controller.cc
@@ -87,6 +87,8 @@ void BluetoothHostPairingController::SendHostStatus() {
host_status.set_api_version(kPairingAPIVersion);
if (!enrollment_domain_.empty())
host_status.mutable_parameters()->set_domain(enrollment_domain_);
+ if (!permanent_id_.empty())
+ host_status.mutable_parameters()->set_permanent_id(permanent_id_);
// TODO(zork): Get these values from the UI. (http://crbug.com/405744)
host_status.mutable_parameters()->set_connectivity(
@@ -420,6 +422,11 @@ void BluetoothHostPairingController::OnEnrollmentStatusChanged(
SendHostStatus();
}
+void BluetoothHostPairingController::SetPermanentId(
+ const std::string& permanent_id) {
+ permanent_id_ = permanent_id;
+}
+
void BluetoothHostPairingController::RequestPinCode(
device::BluetoothDevice* device) {
// Disallow unknown device.
diff --git a/components/pairing/bluetooth_host_pairing_controller.h b/components/pairing/bluetooth_host_pairing_controller.h
index 20ba506..1873935 100644
--- a/components/pairing/bluetooth_host_pairing_controller.h
+++ b/components/pairing/bluetooth_host_pairing_controller.h
@@ -71,6 +71,7 @@ class BluetoothHostPairingController
std::string GetEnrollmentDomain() override;
void OnUpdateStatusChanged(UpdateStatus update_status) override;
void OnEnrollmentStatusChanged(EnrollmentStatus enrollment_status) override;
+ void SetPermanentId(const std::string& permanent_id) override;
// ProtoDecoder::Observer:
void OnHostStatusMessage(const pairing_api::HostStatus& message) override;
@@ -102,6 +103,7 @@ class BluetoothHostPairingController
std::string enrollment_domain_;
UpdateStatus update_status_;
EnrollmentStatus enrollment_status_;
+ std::string permanent_id_;
scoped_refptr<device::BluetoothAdapter> adapter_;
scoped_refptr<device::BluetoothSocket> service_socket_;
diff --git a/components/pairing/fake_host_pairing_controller.cc b/components/pairing/fake_host_pairing_controller.cc
index 25250d02..ebd7084 100644
--- a/components/pairing/fake_host_pairing_controller.cc
+++ b/components/pairing/fake_host_pairing_controller.cc
@@ -130,6 +130,10 @@ void FakeHostPairingController::OnEnrollmentStatusChanged(
EnrollmentStatus enrollment_status) {
}
+void FakeHostPairingController::SetPermanentId(
+ const std::string& permanent_id) {
+}
+
void FakeHostPairingController::PairingStageChanged(Stage new_stage) {
switch (new_stage) {
case STAGE_WAITING_FOR_CONTROLLER: {
diff --git a/components/pairing/fake_host_pairing_controller.h b/components/pairing/fake_host_pairing_controller.h
index 17d6884..fcca881 100644
--- a/components/pairing/fake_host_pairing_controller.h
+++ b/components/pairing/fake_host_pairing_controller.h
@@ -47,6 +47,7 @@ class FakeHostPairingController
std::string GetEnrollmentDomain() override;
void OnUpdateStatusChanged(UpdateStatus update_status) override;
void OnEnrollmentStatusChanged(EnrollmentStatus enrollment_status) override;
+ void SetPermanentId(const std::string& permanent_id) override;
// HostPairingController::Observer:
void PairingStageChanged(Stage new_stage) override;
diff --git a/components/pairing/host_pairing_controller.h b/components/pairing/host_pairing_controller.h
index 731707a..b360d07 100644
--- a/components/pairing/host_pairing_controller.h
+++ b/components/pairing/host_pairing_controller.h
@@ -93,6 +93,9 @@ class HostPairingController {
virtual void OnEnrollmentStatusChanged(
EnrollmentStatus enrollment_status) = 0;
+ // Set the permanent id assigned during enrollment.
+ virtual void SetPermanentId(const std::string& permanent_id) = 0;
+
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
diff --git a/components/pairing/pairing_api.proto b/components/pairing/pairing_api.proto
index 856feae..f0af859 100644
--- a/components/pairing/pairing_api.proto
+++ b/components/pairing/pairing_api.proto
@@ -38,6 +38,7 @@ message HostStatusParameters {
optional UpdateStatus update_status = 3;
optional EnrollmentStatus enrollment_status = 4;
repeated string paired_controllers = 5;
+ optional string permanent_id = 6;
}
message HostStatus {