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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/network_state_informer.h

Issue 15294010: Remove NetworkStateInformer's dependency on ProxyConfigServiceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on Gaurav's CL 15359008. Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 bool is_online() { return state_ == ONLINE; } 99 bool is_online() { return state_ == ONLINE; }
100 State state() const { return state_; } 100 State state() const { return state_; }
101 std::string last_network_service_path() const { 101 std::string last_network_service_path() const {
102 return last_network_service_path_; 102 return last_network_service_path_;
103 } 103 }
104 std::string last_network_type() const { return last_network_type_; } 104 std::string last_network_type() const { return last_network_type_; }
105 105
106 private: 106 private:
107 struct ProxyState {
108 ProxyState() : configured(false) {
109 }
110
111 ProxyState(const std::string& proxy_config, bool configured)
112 : proxy_config(proxy_config),
113 configured(configured) {
114 }
115
116 std::string proxy_config;
117 bool configured;
118 };
119
120 typedef std::map<std::string, ProxyState> ProxyStateMap;
121
122 friend class base::RefCounted<NetworkStateInformer>; 107 friend class base::RefCounted<NetworkStateInformer>;
123 108
124 virtual ~NetworkStateInformer(); 109 virtual ~NetworkStateInformer();
125 110
126 bool UpdateState(); 111 bool UpdateState();
127 112
128 void UpdateStateAndNotify(); 113 void UpdateStateAndNotify();
129 114
130 void SendStateToObservers(ErrorScreenActor::ErrorReason reason); 115 void SendStateToObservers(ErrorScreenActor::ErrorReason reason);
131 116
132 State GetNetworkState(const NetworkState* network); 117 State GetNetworkState(const NetworkState* network);
133 bool IsProxyConfigured(const NetworkState* network); 118 bool IsProxyConfigured(const NetworkState* network);
134 119
135 content::NotificationRegistrar registrar_; 120 content::NotificationRegistrar registrar_;
136 State state_; 121 State state_;
137 NetworkStateInformerDelegate* delegate_; 122 NetworkStateInformerDelegate* delegate_;
138 ObserverList<NetworkStateInformerObserver> observers_; 123 ObserverList<NetworkStateInformerObserver> observers_;
139 std::string last_online_service_path_; 124 std::string last_online_service_path_;
140 std::string last_connected_service_path_; 125 std::string last_connected_service_path_;
141 std::string last_network_service_path_; 126 std::string last_network_service_path_;
142 std::string last_network_type_; 127 std::string last_network_type_;
143 base::CancelableClosure check_state_; 128 base::CancelableClosure check_state_;
144
145 // Caches proxy state for active networks.
146 ProxyStateMap proxy_state_map_;
147 }; 129 };
148 130
149 } // namespace chromeos 131 } // namespace chromeos
150 132
151 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ 133 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/network_state_informer.cc » ('j') | chromeos/network/managed_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698