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

Unified Diff: chrome/browser/local_discovery/privetv3_setup_flow.cc

Issue 468613003: API change to allow sticker authentication for devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/local_discovery/privetv3_setup_flow.cc
diff --git a/chrome/browser/local_discovery/privetv3_setup_flow.cc b/chrome/browser/local_discovery/privetv3_setup_flow.cc
index 97705c76725247908ed3e88f0067eb95dbfc5aa4..64142d77739d85c913b49ceb44c43d677a588c39 100644
--- a/chrome/browser/local_discovery/privetv3_setup_flow.cc
+++ b/chrome/browser/local_discovery/privetv3_setup_flow.cc
@@ -109,19 +109,22 @@ void PrivetV3SetupFlow::SetupWifiAndRegister(const std::string& device_ssid) {
#endif // ENABLE_WIFI_BOOTSTRAPPING
void PrivetV3SetupFlow::OnSetupConfirmationNeeded(
- const std::string& confirmation_code) {
+ const std::string& confirmation_code,
+ extensions::api::gcd_private::ConfirmationType confirmation_type) {
delegate_->ConfirmSecurityCode(confirmation_code,
base::Bind(&PrivetV3SetupFlow::OnCodeConfirmed,
- weak_ptr_factory_.GetWeakPtr()));
+ weak_ptr_factory_.GetWeakPtr(),
+ confirmation_code));
}
-void PrivetV3SetupFlow::OnSessionEstablished() {
- DCHECK(setup_request_);
- session_->StartRequest(setup_request_.get());
-}
-
-void PrivetV3SetupFlow::OnCannotEstablishSession() {
- OnSetupError();
+void PrivetV3SetupFlow::OnSessionStatus(
+ extensions::api::gcd_private::Status status) {
+ if (status == extensions::api::gcd_private::STATUS_SUCCESS) {
+ DCHECK(setup_request_);
+ session_->StartRequest(setup_request_.get());
+ } else {
+ OnSetupError();
+ }
}
void PrivetV3SetupFlow::OnSetupError() {
@@ -159,10 +162,10 @@ void PrivetV3SetupFlow::OnPrivetClientCreated(
session_->Start();
}
-void PrivetV3SetupFlow::OnCodeConfirmed(bool success) {
+void PrivetV3SetupFlow::OnCodeConfirmed(const std::string& code, bool success) {
if (!success)
return OnSetupError();
- session_->ConfirmCode();
+ session_->ConfirmCode(code);
}
} // namespace local_discovery

Powered by Google App Engine
This is Rietveld 408576698