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/ui/webui/chromeos/choose_mobile_network_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const std::string& error_name, | 86 const std::string& error_name, |
87 scoped_ptr<base::DictionaryValue> error_data) { | 87 scoped_ptr<base::DictionaryValue> error_data) { |
88 NET_LOG_ERROR("Operation failed: " + error_name, operation_name); | 88 NET_LOG_ERROR("Operation failed: " + error_name, operation_name); |
89 } | 89 } |
90 | 90 |
91 class ChooseMobileNetworkHandler | 91 class ChooseMobileNetworkHandler |
92 : public WebUIMessageHandler, | 92 : public WebUIMessageHandler, |
93 public NetworkStateHandlerObserver { | 93 public NetworkStateHandlerObserver { |
94 public: | 94 public: |
95 ChooseMobileNetworkHandler(); | 95 ChooseMobileNetworkHandler(); |
96 virtual ~ChooseMobileNetworkHandler(); | 96 ~ChooseMobileNetworkHandler() override; |
97 | 97 |
98 // WebUIMessageHandler implementation. | 98 // WebUIMessageHandler implementation. |
99 virtual void RegisterMessages() override; | 99 void RegisterMessages() override; |
100 | 100 |
101 // NetworkStateHandlerObserver implementation. | 101 // NetworkStateHandlerObserver implementation. |
102 virtual void DeviceListChanged() override; | 102 void DeviceListChanged() override; |
103 | 103 |
104 private: | 104 private: |
105 // Handlers for JS WebUI messages. | 105 // Handlers for JS WebUI messages. |
106 void HandleCancel(const base::ListValue* args); | 106 void HandleCancel(const base::ListValue* args); |
107 void HandleConnect(const base::ListValue* args); | 107 void HandleConnect(const base::ListValue* args); |
108 void HandlePageReady(const base::ListValue* args); | 108 void HandlePageReady(const base::ListValue* args); |
109 | 109 |
110 std::string device_path_; | 110 std::string device_path_; |
111 base::ListValue networks_list_; | 111 base::ListValue networks_list_; |
112 bool is_page_ready_; | 112 bool is_page_ready_; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 : WebUIController(web_ui) { | 256 : WebUIController(web_ui) { |
257 ChooseMobileNetworkHandler* handler = new ChooseMobileNetworkHandler(); | 257 ChooseMobileNetworkHandler* handler = new ChooseMobileNetworkHandler(); |
258 web_ui->AddMessageHandler(handler); | 258 web_ui->AddMessageHandler(handler); |
259 // Set up the "chrome://choose-mobile-network" source. | 259 // Set up the "chrome://choose-mobile-network" source. |
260 Profile* profile = Profile::FromWebUI(web_ui); | 260 Profile* profile = Profile::FromWebUI(web_ui); |
261 content::WebUIDataSource::Add( | 261 content::WebUIDataSource::Add( |
262 profile, CreateChooseMobileNetworkUIHTMLSource()); | 262 profile, CreateChooseMobileNetworkUIHTMLSource()); |
263 } | 263 } |
264 | 264 |
265 } // namespace chromeos | 265 } // namespace chromeos |
OLD | NEW |