| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/cros/cros_network_functions.h" | 5 #include "chrome/browser/chromeos/cros/cros_network_functions.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 virtual ~DataPlanUpdateWatcher() { | 135 virtual ~DataPlanUpdateWatcher() { |
| 136 DBusThreadManager::Get()->GetCashewClient()->ResetDataPlansUpdateHandler(); | 136 DBusThreadManager::Get()->GetCashewClient()->ResetDataPlansUpdateHandler(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 void OnDataPlansUpdate(const std::string& service, | 140 void OnDataPlansUpdate(const std::string& service, |
| 141 const base::ListValue& data_plans) { | 141 const base::ListValue& data_plans) { |
| 142 CellularDataPlanVector* data_plan_vector = new CellularDataPlanVector; | 142 CellularDataPlanVector* data_plan_vector = new CellularDataPlanVector; |
| 143 for (size_t i = 0; i != data_plans.GetSize(); ++i) { | 143 for (size_t i = 0; i != data_plans.GetSize(); ++i) { |
| 144 base::DictionaryValue* data_plan = NULL; | 144 const base::DictionaryValue* data_plan = NULL; |
| 145 if (!data_plans.GetDictionary(i, &data_plan)) { | 145 if (!data_plans.GetDictionary(i, &data_plan)) { |
| 146 LOG(ERROR) << "data_plans[" << i << "] is not a dictionary."; | 146 LOG(ERROR) << "data_plans[" << i << "] is not a dictionary."; |
| 147 continue; | 147 continue; |
| 148 } | 148 } |
| 149 CellularDataPlan* plan = new CellularDataPlan; | 149 CellularDataPlan* plan = new CellularDataPlan; |
| 150 // Plan name. | 150 // Plan name. |
| 151 GetStringProperty(*data_plan, cashew::kCellularPlanNameProperty, | 151 GetStringProperty(*data_plan, cashew::kCellularPlanNameProperty, |
| 152 &plan->plan_name); | 152 &plan->plan_name); |
| 153 // Plan type. | 153 // Plan type. |
| 154 std::string plan_type_string; | 154 std::string plan_type_string; |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 return false; // No powered device found that has a 'Networks' array. | 765 return false; // No powered device found that has a 'Networks' array. |
| 766 return true; | 766 return true; |
| 767 } | 767 } |
| 768 | 768 |
| 769 void CrosConfigureService(const base::DictionaryValue& properties) { | 769 void CrosConfigureService(const base::DictionaryValue& properties) { |
| 770 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService( | 770 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService( |
| 771 properties, base::Bind(&DoNothing)); | 771 properties, base::Bind(&DoNothing)); |
| 772 } | 772 } |
| 773 | 773 |
| 774 } // namespace chromeos | 774 } // namespace chromeos |
| OLD | NEW |