| 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/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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 const content::URLDataSource::GotDataCallback& callback) { | 228 const content::URLDataSource::GotDataCallback& callback) { |
| 229 CellularNetwork* network = NULL; | 229 CellularNetwork* network = NULL; |
| 230 if (!path.empty()) { | 230 if (!path.empty()) { |
| 231 network = CrosLibrary::Get()->GetNetworkLibrary()-> | 231 network = CrosLibrary::Get()->GetNetworkLibrary()-> |
| 232 FindCellularNetworkByPath(path); | 232 FindCellularNetworkByPath(path); |
| 233 } | 233 } |
| 234 | 234 |
| 235 if (!network || (!network->SupportsActivation() && !network->activated())) { | 235 if (!network || (!network->SupportsActivation() && !network->activated())) { |
| 236 LOG(WARNING) << "Can't find device to activate for service path " << path; | 236 LOG(WARNING) << "Can't find device to activate for service path " << path; |
| 237 scoped_refptr<base::RefCountedBytes> html_bytes(new base::RefCountedBytes); | 237 scoped_refptr<base::RefCountedBytes> html_bytes(new base::RefCountedBytes); |
| 238 callback.Run(html_bytes); | 238 callback.Run(html_bytes.get()); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 | 241 |
| 242 LOG(WARNING) << "Starting mobile setup for " << path; | 242 LOG(WARNING) << "Starting mobile setup for " << path; |
| 243 DictionaryValue strings; | 243 DictionaryValue strings; |
| 244 | 244 |
| 245 strings.SetString("connecting_header", | 245 strings.SetString("connecting_header", |
| 246 l10n_util::GetStringFUTF16(IDS_MOBILE_CONNECTING_HEADER, | 246 l10n_util::GetStringFUTF16(IDS_MOBILE_CONNECTING_HEADER, |
| 247 network ? UTF8ToUTF16(network->name()) : string16())); | 247 network ? UTF8ToUTF16(network->name()) : string16())); |
| 248 strings.SetString("error_header", | 248 strings.SetString("error_header", |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 // Set up the chrome://mobilesetup/ source. | 510 // Set up the chrome://mobilesetup/ source. |
| 511 Profile* profile = Profile::FromWebUI(web_ui); | 511 Profile* profile = Profile::FromWebUI(web_ui); |
| 512 content::URLDataSource::Add(profile, html_source); | 512 content::URLDataSource::Add(profile, html_source); |
| 513 } | 513 } |
| 514 | 514 |
| 515 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { | 515 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { |
| 516 // Destroyed by the corresponding RenderViewHost | 516 // Destroyed by the corresponding RenderViewHost |
| 517 new PortalFrameLoadObserver(AsWeakPtr(), host); | 517 new PortalFrameLoadObserver(AsWeakPtr(), host); |
| 518 } | 518 } |
| OLD | NEW |