| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" |
| 12 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 13 #include "base/platform_thread.h" | 14 #include "base/platform_thread.h" |
| 14 #include "base/singleton.h" | 15 #include "base/singleton.h" |
| 15 #include "base/string16.h" | 16 #include "base/string16.h" |
| 16 #include "base/timer.h" | 17 #include "base/timer.h" |
| 17 #include "cros/chromeos_network.h" | 18 #include "cros/chromeos_network.h" |
| 18 | 19 |
| 19 class Value; | 20 class Value; |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 132 } |
| 132 const std::string& path; | 133 const std::string& path; |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 const std::string& name() const { return name_; } | 136 const std::string& name() const { return name_; } |
| 136 int strength() const { return strength_; } | 137 int strength() const { return strength_; } |
| 137 bool auto_connect() const { return auto_connect_; } | 138 bool auto_connect() const { return auto_connect_; } |
| 138 bool favorite() const { return favorite_; } | 139 bool favorite() const { return favorite_; } |
| 139 | 140 |
| 140 void set_auto_connect(bool auto_connect) { auto_connect_ = auto_connect; } | 141 void set_auto_connect(bool auto_connect) { auto_connect_ = auto_connect; } |
| 141 void set_favorite(bool favorite) { favorite_ = favorite; } | 142 // We don't have a setter for |favorite_| because to unfavorite a network is |
| 143 // equivalent to forget a network, so we call forget network on cros for |
| 144 // that. See ForgetWifiNetwork(). |
| 142 | 145 |
| 143 // Network overrides. | 146 // Network overrides. |
| 144 virtual void Clear(); | 147 virtual void Clear(); |
| 145 | 148 |
| 146 protected: | 149 protected: |
| 147 WirelessNetwork() | 150 WirelessNetwork() |
| 148 : Network(), | 151 : Network(), |
| 149 strength_(0), | 152 strength_(0), |
| 150 auto_connect_(false), | 153 auto_connect_(false), |
| 151 favorite_(false) {} | 154 favorite_(false) {} |
| 152 explicit WirelessNetwork(const WirelessNetwork& network); | 155 explicit WirelessNetwork(const WirelessNetwork& network); |
| 153 explicit WirelessNetwork(const ServiceInfo* service); | 156 explicit WirelessNetwork(const ServiceInfo* service); |
| 154 virtual ~WirelessNetwork() {} | 157 virtual ~WirelessNetwork() {} |
| 155 std::string name_; | 158 std::string name_; |
| 156 int strength_; | 159 int strength_; |
| 157 bool auto_connect_; | 160 bool auto_connect_; |
| 158 bool favorite_; | 161 bool favorite_; |
| 159 | 162 |
| 160 private: | 163 private: |
| 164 // ChangeAutoConnectSaveTest accesses |favorite_|. |
| 165 FRIEND_TEST_ALL_PREFIXES(WifiConfigViewTest, ChangeAutoConnectSaveTest); |
| 166 |
| 161 void set_name(const std::string& name) { name_ = name; } | 167 void set_name(const std::string& name) { name_ = name; } |
| 162 void set_strength(int strength) { strength_ = strength; } | 168 void set_strength(int strength) { strength_ = strength; } |
| 163 | 169 |
| 164 friend class NetworkLibraryImpl; | 170 friend class NetworkLibraryImpl; |
| 165 }; | 171 }; |
| 166 | 172 |
| 167 class CellularDataPlan { | 173 class CellularDataPlan { |
| 168 public: | 174 public: |
| 169 CellularDataPlan() : | 175 CellularDataPlan() : |
| 170 plan_name("Unknown"), | 176 plan_name("Unknown"), |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 virtual std::string GetHtmlInfo(int refresh) = 0; | 596 virtual std::string GetHtmlInfo(int refresh) = 0; |
| 591 | 597 |
| 592 // Factory function, creates a new instance and returns ownership. | 598 // Factory function, creates a new instance and returns ownership. |
| 593 // For normal usage, access the singleton via CrosLibrary::Get(). | 599 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 594 static NetworkLibrary* GetImpl(bool stub); | 600 static NetworkLibrary* GetImpl(bool stub); |
| 595 }; | 601 }; |
| 596 | 602 |
| 597 } // namespace chromeos | 603 } // namespace chromeos |
| 598 | 604 |
| 599 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 605 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |