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_STATUS_NETWORK_MENU_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // -------------------------------- | 45 // -------------------------------- |
46 // <IP Address> | 46 // <IP Address> |
47 // Network settings... | 47 // Network settings... |
48 // | 48 // |
49 // <icon> will show the strength of the wifi/cellular networks. | 49 // <icon> will show the strength of the wifi/cellular networks. |
50 // The label will be BOLD if the network is currently connected. | 50 // The label will be BOLD if the network is currently connected. |
51 class NetworkMenu : public views::ViewMenuDelegate, | 51 class NetworkMenu : public views::ViewMenuDelegate, |
52 public menus::MenuModel { | 52 public menus::MenuModel { |
53 public: | 53 public: |
54 struct NetworkInfo { | 54 struct NetworkInfo { |
55 NetworkInfo() : need_passphrase(false), remembered(true) {} | 55 NetworkInfo() : |
| 56 need_passphrase(false), remembered(true), auto_connect(true) {} |
56 // "ethernet" | "wifi" | "cellular" | "other". | 57 // "ethernet" | "wifi" | "cellular" | "other". |
57 std::string network_type; | 58 std::string network_type; |
58 // "connected" | "connecting" | "disconnected" | "error". | 59 // "connected" | "connecting" | "disconnected" | "error". |
59 std::string status; | 60 std::string status; |
60 // status message or error message, empty if unknown status. | 61 // status message or error message, empty if unknown status. |
61 std::string message; | 62 std::string message; |
62 // IP address (if network is active, empty otherwise) | 63 // IP address (if network is active, empty otherwise) |
63 std::string ip_address; | 64 std::string ip_address; |
64 // Remembered passphrase. | 65 // Remembered passphrase. |
65 std::string passphrase; | 66 std::string passphrase; |
66 // true if the network requires a passphrase. | 67 // true if the network requires a passphrase. |
67 bool need_passphrase; | 68 bool need_passphrase; |
68 // true if the network is currently remembered. | 69 // true if the network is currently remembered. |
69 bool remembered; | 70 bool remembered; |
| 71 // true if the network is auto connect (meaningful for Wifi only). |
| 72 bool auto_connect; |
70 }; | 73 }; |
71 | 74 |
72 NetworkMenu(); | 75 NetworkMenu(); |
73 virtual ~NetworkMenu(); | 76 virtual ~NetworkMenu(); |
74 | 77 |
75 // Retrieves network info for the DOMUI NetworkMenu (NetworkMenuUI). | 78 // Retrieves network info for the DOMUI NetworkMenu (NetworkMenuUI). |
76 // |index| is the index in menu_items_, set when the menu is built. | 79 // |index| is the index in menu_items_, set when the menu is built. |
77 bool GetNetworkAt(int index, NetworkInfo* info) const; | 80 bool GetNetworkAt(int index, NetworkInfo* info) const; |
78 | 81 |
79 // Connect or reconnect to the network at |index|. | 82 // Connect or reconnect to the network at |index|. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 223 |
221 // If true, call into the settings UI for network configuration dialogs. | 224 // If true, call into the settings UI for network configuration dialogs. |
222 bool use_settings_ui_; | 225 bool use_settings_ui_; |
223 | 226 |
224 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); | 227 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); |
225 }; | 228 }; |
226 | 229 |
227 } // namespace chromeos | 230 } // namespace chromeos |
228 | 231 |
229 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 232 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
OLD | NEW |