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

Side by Side Diff: chromeos/network/network_connection_handler.cc

Issue 22950007: Insufficient information on activation details should be handled correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit, added some other changes that fell into this CL. Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/network/network_connection_handler.h" 5 #include "chromeos/network/network_connection_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "chromeos/chromeos_switches.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 void CopyStringFromDictionary(const base::DictionaryValue& source, 50 void CopyStringFromDictionary(const base::DictionaryValue& source,
51 const std::string& key, 51 const std::string& key,
52 base::DictionaryValue* dest) { 52 base::DictionaryValue* dest) {
53 std::string string_value; 53 std::string string_value;
54 if (source.GetStringWithoutPathExpansion(key, &string_value)) 54 if (source.GetStringWithoutPathExpansion(key, &string_value))
55 dest->SetStringWithoutPathExpansion(key, string_value); 55 dest->SetStringWithoutPathExpansion(key, string_value);
56 } 56 }
57 57
58 bool NetworkRequiresActivation(const NetworkState* network) { 58 bool NetworkRequiresActivation(const NetworkState* network) {
59 return (network->type() == flimflam::kTypeCellular && 59 return (network->type() == flimflam::kTypeCellular &&
60 (network->activation_state() != flimflam::kActivationStateActivated || 60 ((network->activation_state() != flimflam::kActivationStateActivated &&
61 network->cellular_out_of_credits())); 61 network->activation_state() != flimflam::kActivationStateUnknown)));
62 } 62 }
63 63
64 bool VPNIsConfigured(const std::string& service_path, 64 bool VPNIsConfigured(const std::string& service_path,
65 const std::string& provider_type, 65 const std::string& provider_type,
66 const base::DictionaryValue& provider_properties) { 66 const base::DictionaryValue& provider_properties) {
67 if (provider_type == flimflam::kProviderOpenVpn) { 67 if (provider_type == flimflam::kProviderOpenVpn) {
68 std::string hostname; 68 std::string hostname;
69 provider_properties.GetStringWithoutPathExpansion( 69 provider_properties.GetStringWithoutPathExpansion(
70 flimflam::kHostProperty, &hostname); 70 flimflam::kHostProperty, &hostname);
71 if (hostname.empty()) { 71 if (hostname.empty()) {
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 715
716 void NetworkConnectionHandler::HandleShillActivateSuccess( 716 void NetworkConnectionHandler::HandleShillActivateSuccess(
717 const std::string& service_path, 717 const std::string& service_path,
718 const base::Closure& success_callback) { 718 const base::Closure& success_callback) {
719 NET_LOG_EVENT("Activate Request Sent", service_path); 719 NET_LOG_EVENT("Activate Request Sent", service_path);
720 if (!success_callback.is_null()) 720 if (!success_callback.is_null())
721 success_callback.Run(); 721 success_callback.Run();
722 } 722 }
723 723
724 } // namespace chromeos 724 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698