OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/arc/net/arc_net_host_impl.h" | 5 #include "components/arc/net/arc_net_host_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 return chromeos::LoginState::Get()->GetLoggedInUserType() == | 48 return chromeos::LoginState::Get()->GetLoggedInUserType() == |
49 chromeos::LoginState::LOGGED_IN_USER_OWNER; | 49 chromeos::LoginState::LOGGED_IN_USER_OWNER; |
50 } | 50 } |
51 | 51 |
52 std::string GetStringFromOncDictionary(const base::DictionaryValue* dict, | 52 std::string GetStringFromOncDictionary(const base::DictionaryValue* dict, |
53 const char* key, | 53 const char* key, |
54 bool required) { | 54 bool required) { |
55 std::string value; | 55 std::string value; |
56 dict->GetString(key, &value); | 56 dict->GetString(key, &value); |
57 if (required && value.empty()) | 57 if (required && value.empty()) |
58 NOTREACHED(); | 58 VLOG(1) << "Required parameter " << key << " was not found."; |
Luis Héctor Chávez
2017/03/01 23:17:09
maybe NOTREACHED() << ... ?
| |
59 return value; | 59 return value; |
60 } | 60 } |
61 | 61 |
62 arc::mojom::SecurityType TranslateONCWifiSecurityType( | 62 arc::mojom::SecurityType TranslateONCWifiSecurityType( |
63 const base::DictionaryValue* dict) { | 63 const base::DictionaryValue* dict) { |
64 std::string type = GetStringFromOncDictionary(dict, onc::wifi::kSecurity, | 64 std::string type = GetStringFromOncDictionary(dict, onc::wifi::kSecurity, |
65 true /* required */); | 65 true /* required */); |
66 if (type == onc::wifi::kWEP_PSK) | 66 if (type == onc::wifi::kWEP_PSK) |
67 return arc::mojom::SecurityType::WEP_PSK; | 67 return arc::mojom::SecurityType::WEP_PSK; |
68 else if (type == onc::wifi::kWEP_8021X) | 68 else if (type == onc::wifi::kWEP_8021X) |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 net_instance->WifiEnabledStateChanged(is_enabled); | 654 net_instance->WifiEnabledStateChanged(is_enabled); |
655 } | 655 } |
656 | 656 |
657 void ArcNetHostImpl::OnShuttingDown() { | 657 void ArcNetHostImpl::OnShuttingDown() { |
658 DCHECK(observing_network_state_); | 658 DCHECK(observing_network_state_); |
659 GetStateHandler()->RemoveObserver(this, FROM_HERE); | 659 GetStateHandler()->RemoveObserver(this, FROM_HERE); |
660 observing_network_state_ = false; | 660 observing_network_state_ = false; |
661 } | 661 } |
662 | 662 |
663 } // namespace arc | 663 } // namespace arc |
OLD | NEW |