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

Side by Side Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 854063002: Update {virtual,override,final} to follow C++11 style chrome/browser/ui/webui/chromeos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 value->SetString("error", error_description); 136 value->SetString("error", error_description);
137 } 137 }
138 138
139 } // namespace 139 } // namespace
140 140
141 class MobileSetupUIHTMLSource : public content::URLDataSource { 141 class MobileSetupUIHTMLSource : public content::URLDataSource {
142 public: 142 public:
143 MobileSetupUIHTMLSource(); 143 MobileSetupUIHTMLSource();
144 144
145 // content::URLDataSource implementation. 145 // content::URLDataSource implementation.
146 virtual std::string GetSource() const override; 146 std::string GetSource() const override;
147 virtual void StartDataRequest( 147 void StartDataRequest(
148 const std::string& path, 148 const std::string& path,
149 int render_process_id, 149 int render_process_id,
150 int render_frame_id, 150 int render_frame_id,
151 const content::URLDataSource::GotDataCallback& callback) override; 151 const content::URLDataSource::GotDataCallback& callback) override;
152 virtual std::string GetMimeType(const std::string&) const override { 152 std::string GetMimeType(const std::string&) const override {
153 return "text/html"; 153 return "text/html";
154 } 154 }
155 virtual bool ShouldAddContentSecurityPolicy() const override { 155 bool ShouldAddContentSecurityPolicy() const override { return false; }
156 return false;
157 }
158 156
159 private: 157 private:
160 virtual ~MobileSetupUIHTMLSource() {} 158 ~MobileSetupUIHTMLSource() override {}
161 159
162 void GetPropertiesAndStartDataRequest( 160 void GetPropertiesAndStartDataRequest(
163 const content::URLDataSource::GotDataCallback& callback, 161 const content::URLDataSource::GotDataCallback& callback,
164 const std::string& service_path, 162 const std::string& service_path,
165 const base::DictionaryValue& properties); 163 const base::DictionaryValue& properties);
166 void GetPropertiesFailure( 164 void GetPropertiesFailure(
167 const content::URLDataSource::GotDataCallback& callback, 165 const content::URLDataSource::GotDataCallback& callback,
168 const std::string& service_path, 166 const std::string& service_path,
169 const std::string& error_name, 167 const std::string& error_name,
170 scoped_ptr<base::DictionaryValue> error_data); 168 scoped_ptr<base::DictionaryValue> error_data);
171 169
172 base::WeakPtrFactory<MobileSetupUIHTMLSource> weak_ptr_factory_; 170 base::WeakPtrFactory<MobileSetupUIHTMLSource> weak_ptr_factory_;
173 171
174 DISALLOW_COPY_AND_ASSIGN(MobileSetupUIHTMLSource); 172 DISALLOW_COPY_AND_ASSIGN(MobileSetupUIHTMLSource);
175 }; 173 };
176 174
177 // The handler for Javascript messages related to the "register" view. 175 // The handler for Javascript messages related to the "register" view.
178 class MobileSetupHandler 176 class MobileSetupHandler
179 : public WebUIMessageHandler, 177 : public WebUIMessageHandler,
180 public MobileActivator::Observer, 178 public MobileActivator::Observer,
181 public chromeos::NetworkStateHandlerObserver, 179 public chromeos::NetworkStateHandlerObserver,
182 public base::SupportsWeakPtr<MobileSetupHandler> { 180 public base::SupportsWeakPtr<MobileSetupHandler> {
183 public: 181 public:
184 MobileSetupHandler(); 182 MobileSetupHandler();
185 virtual ~MobileSetupHandler(); 183 ~MobileSetupHandler() override;
186 184
187 // WebUIMessageHandler implementation. 185 // WebUIMessageHandler implementation.
188 virtual void RegisterMessages() override; 186 void RegisterMessages() override;
189 187
190 private: 188 private:
191 enum Type { 189 enum Type {
192 TYPE_UNDETERMINED, 190 TYPE_UNDETERMINED,
193 // The network is not yet activated, and the webui is in activation flow. 191 // The network is not yet activated, and the webui is in activation flow.
194 TYPE_ACTIVATION, 192 TYPE_ACTIVATION,
195 // The network is activated, the webui displays network portal. 193 // The network is activated, the webui displays network portal.
196 TYPE_PORTAL, 194 TYPE_PORTAL,
197 // Same as TYPE_PORTAL, but the network technology is LTE. The webui is 195 // Same as TYPE_PORTAL, but the network technology is LTE. The webui is
198 // additionally aware of network manager state and whether the portal can be 196 // additionally aware of network manager state and whether the portal can be
199 // reached. 197 // reached.
200 TYPE_PORTAL_LTE 198 TYPE_PORTAL_LTE
201 }; 199 };
202 200
203 // MobileActivator::Observer. 201 // MobileActivator::Observer.
204 virtual void OnActivationStateChanged( 202 void OnActivationStateChanged(const NetworkState* network,
205 const NetworkState* network, 203 MobileActivator::PlanActivationState new_state,
206 MobileActivator::PlanActivationState new_state, 204 const std::string& error_description) override;
207 const std::string& error_description) override;
208 205
209 // Callbacks for NetworkConfigurationHandler::GetProperties. 206 // Callbacks for NetworkConfigurationHandler::GetProperties.
210 void GetPropertiesAndCallStatusChanged( 207 void GetPropertiesAndCallStatusChanged(
211 MobileActivator::PlanActivationState state, 208 MobileActivator::PlanActivationState state,
212 const std::string& error_description, 209 const std::string& error_description,
213 const std::string& service_path, 210 const std::string& service_path,
214 const base::DictionaryValue& properties); 211 const base::DictionaryValue& properties);
215 void GetPropertiesAndCallGetDeviceInfo( 212 void GetPropertiesAndCallGetDeviceInfo(
216 const std::string& service_path, 213 const std::string& service_path,
217 const base::DictionaryValue& properties); 214 const base::DictionaryValue& properties);
218 void GetPropertiesFailure( 215 void GetPropertiesFailure(
219 const std::string& service_path, 216 const std::string& service_path,
220 const std::string& callback_name, 217 const std::string& callback_name,
221 const std::string& error_name, 218 const std::string& error_name,
222 scoped_ptr<base::DictionaryValue> error_data); 219 scoped_ptr<base::DictionaryValue> error_data);
223 220
224 // Handlers for JS WebUI messages. 221 // Handlers for JS WebUI messages.
225 void HandleSetTransactionStatus(const base::ListValue* args); 222 void HandleSetTransactionStatus(const base::ListValue* args);
226 void HandleStartActivation(const base::ListValue* args); 223 void HandleStartActivation(const base::ListValue* args);
227 void HandlePaymentPortalLoad(const base::ListValue* args); 224 void HandlePaymentPortalLoad(const base::ListValue* args);
228 void HandleGetDeviceInfo(const base::ListValue* args); 225 void HandleGetDeviceInfo(const base::ListValue* args);
229 226
230 // NetworkStateHandlerObserver implementation. 227 // NetworkStateHandlerObserver implementation.
231 virtual void NetworkConnectionStateChanged( 228 void NetworkConnectionStateChanged(const NetworkState* network) override;
232 const NetworkState* network) override; 229 void DefaultNetworkChanged(const NetworkState* default_network) override;
233 virtual void DefaultNetworkChanged(
234 const NetworkState* default_network) override;
235 230
236 // Updates |lte_portal_reachable_| for lte network |network| and notifies 231 // Updates |lte_portal_reachable_| for lte network |network| and notifies
237 // webui of the new state if the reachability changed or |force_notification| 232 // webui of the new state if the reachability changed or |force_notification|
238 // is set. 233 // is set.
239 void UpdatePortalReachability(const NetworkState* network, 234 void UpdatePortalReachability(const NetworkState* network,
240 bool force_notification); 235 bool force_notification);
241 236
242 // Sends message to host registration page with system/user info data. 237 // Sends message to host registration page with system/user info data.
243 void SendDeviceInfo(); 238 void SendDeviceInfo();
244 239
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 const GURL& validated_url, 644 const GURL& validated_url,
650 int error_code, 645 int error_code,
651 const base::string16& error_description) { 646 const base::string16& error_description) {
652 if (render_frame_host->GetFrameName() != "paymentForm") 647 if (render_frame_host->GetFrameName() != "paymentForm")
653 return; 648 return;
654 649
655 base::FundamentalValue result_value(-error_code); 650 base::FundamentalValue result_value(-error_code);
656 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, 651 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback,
657 result_value); 652 result_value);
658 } 653 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/mobile_setup_ui.h ('k') | chrome/browser/ui/webui/chromeos/network_config_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698