buffet: Device registration accepts "description", "location" and "display_name".

This values provided by device client by privet API.

BUG=chromium:435687
TEST=unittests

Change-Id: I47ce4a932739c27a3b8dc23f8ec404e9814c3eeb
Reviewed-on: https://chromium-review.googlesource.com/231437
Reviewed-by: Anton Muhin <antonm@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/device_registration_info.cc b/buffet/device_registration_info.cc
index cd3cd2b..a54825c 100644
--- a/buffet/device_registration_info.cc
+++ b/buffet/device_registration_info.cc
@@ -47,6 +47,8 @@
 const char kDeviceKind[]    = "device_kind";
 const char kName[]          = "name";
 const char kDisplayName[]   = "display_name";
+const char kDescription[]   = "description";
+const char kLocation[]      = "location";
 
 }  // namespace storage_keys
 }  // namespace buffet
@@ -337,6 +339,10 @@
   resource->SetString("name", name_);
   if (!display_name_.empty())
     resource->SetString("displayName", display_name_);
+  if (!description_.empty())
+    resource->SetString("description", description_);
+  if (!location_.empty())
+    resource->SetString("location", location_);
   resource->SetString("channel.supportedType", "xmpp");
   resource->Set("commandDefs", commands.release());
   resource->Set("state", state.release());
@@ -389,6 +395,8 @@
   GetParamValue(params, storage_keys::kDeviceKind, &device_kind_);
   GetParamValue(params, storage_keys::kName, &name_);
   GetParamValue(params, storage_keys::kDisplayName, &display_name_);
+  GetParamValue(params, storage_keys::kDescription, &description_);
+  GetParamValue(params, storage_keys::kLocation, &location_);
   GetParamValue(params, storage_keys::kOAuthURL, &oauth_url_);
   GetParamValue(params, storage_keys::kServiceURL, &service_url_);
 
diff --git a/buffet/device_registration_info.h b/buffet/device_registration_info.h
index fad4dfd..91b897c 100644
--- a/buffet/device_registration_info.h
+++ b/buffet/device_registration_info.h
@@ -180,6 +180,8 @@
   std::string device_kind_ = "vendor";
   std::string name_ = "coffee_pot";
   std::string display_name_ = "Coffee Pot";
+  std::string description_ = "Easy to clean";
+  std::string location_ = "Kitchen";
 
   // HTTP transport used for communications.
   std::shared_ptr<chromeos::http::Transport> transport_;
diff --git a/buffet/device_registration_info_unittest.cc b/buffet/device_registration_info_unittest.cc
index dd8ffbe..38ada93 100644
--- a/buffet/device_registration_info_unittest.cc
+++ b/buffet/device_registration_info_unittest.cc
@@ -290,6 +290,12 @@
     EXPECT_EQ(test_data::kClientId, value);
     EXPECT_TRUE(json->GetString("deviceDraft.deviceKind", &value));
     EXPECT_EQ("vendor", value);
+    EXPECT_TRUE(json->GetString("deviceDraft.description", &value));
+    EXPECT_EQ("Easy to clean", value);
+    EXPECT_TRUE(json->GetString("deviceDraft.location", &value));
+    EXPECT_EQ("Kitchen", value);
+    EXPECT_TRUE(json->GetString("deviceDraft.displayName", &value));
+    EXPECT_EQ("Coffee Pot", value);
     base::DictionaryValue* commandDefs = nullptr;
     EXPECT_TRUE(json->GetDictionary("deviceDraft.commandDefs", &commandDefs));
     EXPECT_FALSE(commandDefs->empty());
diff --git a/buffet/device_registration_storage_keys.h b/buffet/device_registration_storage_keys.h
index 2888f5e..d7946bc 100644
--- a/buffet/device_registration_storage_keys.h
+++ b/buffet/device_registration_storage_keys.h
@@ -24,6 +24,8 @@
 extern const char kDeviceKind[];
 extern const char kName[];
 extern const char kDisplayName[];
+extern const char kDescription[];
+extern const char kLocation[];
 
 }  // namespace storage_keys
 }  // namespace buffet