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 59feaa093bf5b19cacdff73677da42f6eb8d467d..81c94159e9f8c0fcdc1ddfc5d07d0ca074d4170f 100644 |
--- a/chrome/browser/local_discovery/privetv3_setup_flow.cc |
+++ b/chrome/browser/local_discovery/privetv3_setup_flow.cc |
@@ -86,11 +86,15 @@ void PrivetV3SetupFlow::OnCodeConfirmed(bool success) { |
void PrivetV3SetupFlow::OnSessionInitialized( |
PrivetV3Session::Result result, |
const std::vector<PrivetV3Session::PairingType>& types) { |
- if (result != PrivetV3Session::Result::STATUS_SUCCESS) |
+ if (result != PrivetV3Session::Result::STATUS_SUCCESS || |
+ !std::count(types.begin(), types.end(), |
+ PrivetV3Session::PairingType::PAIRING_TYPE_EMBEDDEDCODE)) { |
Aleksey Shlyapnikov
2015/01/26 21:47:45
std::count will iterate over all elements, use std
|
return OnSetupError(); |
- session_->StartPairing(PrivetV3Session::PairingType::PAIRING_TYPE_PINCODE, |
- base::Bind(&PrivetV3SetupFlow::OnPairingStarted, |
- weak_ptr_factory_.GetWeakPtr())); |
+ } |
+ session_->StartPairing( |
+ PrivetV3Session::PairingType::PAIRING_TYPE_EMBEDDEDCODE, |
+ base::Bind(&PrivetV3SetupFlow::OnPairingStarted, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
void PrivetV3SetupFlow::OnPairingStarted(PrivetV3Session::Result result) { |