| 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 #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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 const std::string& device_path() const { return device_path_; } | 354 const std::string& device_path() const { return device_path_; } |
| 355 const std::string& ip_address() const { return ip_address_; } | 355 const std::string& ip_address() const { return ip_address_; } |
| 356 ConnectionType type() const { return type_; } | 356 ConnectionType type() const { return type_; } |
| 357 ConnectionMode mode() const { return mode_; } | 357 ConnectionMode mode() const { return mode_; } |
| 358 ConnectionState connection_state() const { return state_; } | 358 ConnectionState connection_state() const { return state_; } |
| 359 bool connecting() const { return IsConnectingState(state_); } | 359 bool connecting() const { return IsConnectingState(state_); } |
| 360 bool configuring() const { return state_ == STATE_CONFIGURATION; } | 360 bool configuring() const { return state_ == STATE_CONFIGURATION; } |
| 361 bool connected() const { return IsConnectedState(state_); } | 361 bool connected() const { return IsConnectedState(state_); } |
| 362 bool connecting_or_connected() const { return connecting() || connected(); } | 362 bool connecting_or_connected() const { return connecting() || connected(); } |
| 363 // True when a user-initiated connection attempt is in progress | 363 // True when a user-initiated connection attempt is in progress |
| 364 bool connection_started() const { return connection_started_; } | 364 bool connection_started() const { |
| 365 return user_connect_state_ == USER_CONNECT_STARTED; |
| 366 } |
| 367 UserConnectState user_connect_state() const { return user_connect_state_; } |
| 365 bool failed() const { return state_ == STATE_FAILURE; } | 368 bool failed() const { return state_ == STATE_FAILURE; } |
| 366 bool disconnected() const { return IsDisconnectedState(state_); } | 369 bool disconnected() const { return IsDisconnectedState(state_); } |
| 367 bool ready() const { return state_ == STATE_READY; } | 370 bool ready() const { return state_ == STATE_READY; } |
| 368 bool online() const { return state_ == STATE_ONLINE; } | 371 bool online() const { return state_ == STATE_ONLINE; } |
| 369 bool restricted_pool() const { return state_ == STATE_PORTAL; } | 372 bool restricted_pool() const { return state_ == STATE_PORTAL; } |
| 370 ConnectionError error() const { return error_; } | 373 ConnectionError error() const { return error_; } |
| 371 ConnectionState state() const { return state_; } | 374 ConnectionState state() const { return state_; } |
| 372 // Is this network connectable. Currently, this is mainly used by 802.1x | 375 // Is this network connectable. Currently, this is mainly used by 802.1x |
| 373 // networks to specify that the network is not configured yet. | 376 // networks to specify that the network is not configured yet. |
| 374 bool connectable() const { return connectable_; } | 377 bool connectable() const { return connectable_; } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 void set_connecting() { | 558 void set_connecting() { |
| 556 state_ = STATE_CONNECT_REQUESTED; | 559 state_ = STATE_CONNECT_REQUESTED; |
| 557 } | 560 } |
| 558 void set_connected() { | 561 void set_connected() { |
| 559 state_ = STATE_ONLINE; | 562 state_ = STATE_ONLINE; |
| 560 } | 563 } |
| 561 void set_disconnected() { | 564 void set_disconnected() { |
| 562 state_ = STATE_IDLE; | 565 state_ = STATE_IDLE; |
| 563 } | 566 } |
| 564 void set_connectable(bool connectable) { connectable_ = connectable; } | 567 void set_connectable(bool connectable) { connectable_ = connectable; } |
| 565 void set_connection_started(bool started) { connection_started_ = started; } | 568 void set_user_connect_state(UserConnectState user_connect_state) { |
| 569 user_connect_state_ = user_connect_state; |
| 570 } |
| 566 void set_is_active(bool is_active) { is_active_ = is_active; } | 571 void set_is_active(bool is_active) { is_active_ = is_active; } |
| 567 void set_added(bool added) { added_ = added; } | 572 void set_added(bool added) { added_ = added; } |
| 568 void set_auto_connect(bool auto_connect) { auto_connect_ = auto_connect; } | 573 void set_auto_connect(bool auto_connect) { auto_connect_ = auto_connect; } |
| 569 void set_save_credentials(bool save_credentials) { | 574 void set_save_credentials(bool save_credentials) { |
| 570 save_credentials_ = save_credentials; | 575 save_credentials_ = save_credentials; |
| 571 } | 576 } |
| 572 void set_profile_path(const std::string& path) { profile_path_ = path; } | 577 void set_profile_path(const std::string& path) { profile_path_ = path; } |
| 573 void set_profile_type(NetworkProfileType type) { profile_type_ = type; } | 578 void set_profile_type(NetworkProfileType type) { profile_type_ = type; } |
| 574 void set_proxy_config(const std::string& proxy) { proxy_config_ = proxy; } | 579 void set_proxy_config(const std::string& proxy) { proxy_config_ = proxy; } |
| 575 void set_ui_data(const NetworkUIData& ui_data) { | 580 void set_ui_data(const NetworkUIData& ui_data) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 594 const NetworkIPConfigVector& ip_configs, | 599 const NetworkIPConfigVector& ip_configs, |
| 595 const std::string& hardware_address); | 600 const std::string& hardware_address); |
| 596 | 601 |
| 597 std::string device_path_; | 602 std::string device_path_; |
| 598 std::string name_; | 603 std::string name_; |
| 599 std::string ip_address_; | 604 std::string ip_address_; |
| 600 ConnectionMode mode_; | 605 ConnectionMode mode_; |
| 601 ConnectionState state_; | 606 ConnectionState state_; |
| 602 ConnectionError error_; | 607 ConnectionError error_; |
| 603 bool connectable_; | 608 bool connectable_; |
| 604 bool connection_started_; | 609 UserConnectState user_connect_state_; |
| 605 bool is_active_; | 610 bool is_active_; |
| 606 int priority_; // determines order in network list. | 611 int priority_; // determines order in network list. |
| 607 bool auto_connect_; | 612 bool auto_connect_; |
| 608 bool save_credentials_; // save passphrase and EAP credentials to disk. | 613 bool save_credentials_; // save passphrase and EAP credentials to disk. |
| 609 std::string proxy_config_; // ProxyConfig property in shill. | 614 std::string proxy_config_; // ProxyConfig property in shill. |
| 610 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. | 615 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. |
| 611 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; | 616 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; |
| 612 | 617 |
| 613 // Unique identifier, set the first time the network is parsed. | 618 // Unique identifier, set the first time the network is parsed. |
| 614 std::string unique_id_; | 619 std::string unique_id_; |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 const std::string& service_path) = 0; | 1724 const std::string& service_path) = 0; |
| 1720 | 1725 |
| 1721 // Factory function, creates a new instance and returns ownership. | 1726 // Factory function, creates a new instance and returns ownership. |
| 1722 // For normal usage, access the singleton via CrosLibrary::Get(). | 1727 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1723 static NetworkLibrary* GetImpl(bool stub); | 1728 static NetworkLibrary* GetImpl(bool stub); |
| 1724 }; | 1729 }; |
| 1725 | 1730 |
| 1726 } // namespace chromeos | 1731 } // namespace chromeos |
| 1727 | 1732 |
| 1728 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1733 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |