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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 base::WeakPtr<MobileSetupUI> parent_; | 119 base::WeakPtr<MobileSetupUI> parent_; |
120 DISALLOW_COPY_AND_ASSIGN(PortalFrameLoadObserver); | 120 DISALLOW_COPY_AND_ASSIGN(PortalFrameLoadObserver); |
121 }; | 121 }; |
122 | 122 |
123 class MobileSetupUIHTMLSource : public content::URLDataSource { | 123 class MobileSetupUIHTMLSource : public content::URLDataSource { |
124 public: | 124 public: |
125 MobileSetupUIHTMLSource(); | 125 MobileSetupUIHTMLSource(); |
126 | 126 |
127 // content::URLDataSource implementation. | 127 // content::URLDataSource implementation. |
128 virtual std::string GetSource() OVERRIDE; | 128 virtual std::string GetSource() const OVERRIDE; |
129 virtual void StartDataRequest( | 129 virtual void StartDataRequest( |
130 const std::string& path, | 130 const std::string& path, |
131 bool is_incognito, | 131 bool is_incognito, |
132 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 132 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
133 virtual std::string GetMimeType(const std::string&) const OVERRIDE { | 133 virtual std::string GetMimeType(const std::string&) const OVERRIDE { |
134 return "text/html"; | 134 return "text/html"; |
135 } | 135 } |
136 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE { | 136 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE { |
137 return false; | 137 return false; |
138 } | 138 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 //////////////////////////////////////////////////////////////////////////////// | 211 //////////////////////////////////////////////////////////////////////////////// |
212 // | 212 // |
213 // MobileSetupUIHTMLSource | 213 // MobileSetupUIHTMLSource |
214 // | 214 // |
215 //////////////////////////////////////////////////////////////////////////////// | 215 //////////////////////////////////////////////////////////////////////////////// |
216 | 216 |
217 MobileSetupUIHTMLSource::MobileSetupUIHTMLSource() { | 217 MobileSetupUIHTMLSource::MobileSetupUIHTMLSource() { |
218 } | 218 } |
219 | 219 |
220 std::string MobileSetupUIHTMLSource::GetSource() { | 220 std::string MobileSetupUIHTMLSource::GetSource() const { |
221 return chrome::kChromeUIMobileSetupHost; | 221 return chrome::kChromeUIMobileSetupHost; |
222 } | 222 } |
223 | 223 |
224 void MobileSetupUIHTMLSource::StartDataRequest( | 224 void MobileSetupUIHTMLSource::StartDataRequest( |
225 const std::string& path, | 225 const std::string& path, |
226 bool is_incognito, | 226 bool is_incognito, |
227 const content::URLDataSource::GotDataCallback& callback) { | 227 const content::URLDataSource::GotDataCallback& callback) { |
228 CellularNetwork* network = NULL; | 228 CellularNetwork* network = NULL; |
229 if (!path.empty()) { | 229 if (!path.empty()) { |
230 network = CrosLibrary::Get()->GetNetworkLibrary()-> | 230 network = CrosLibrary::Get()->GetNetworkLibrary()-> |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 // Set up the chrome://mobilesetup/ source. | 507 // Set up the chrome://mobilesetup/ source. |
508 Profile* profile = Profile::FromWebUI(web_ui); | 508 Profile* profile = Profile::FromWebUI(web_ui); |
509 content::URLDataSource::Add(profile, html_source); | 509 content::URLDataSource::Add(profile, html_source); |
510 } | 510 } |
511 | 511 |
512 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { | 512 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { |
513 // Destroyed by the corresponding RenderViewHost | 513 // Destroyed by the corresponding RenderViewHost |
514 new PortalFrameLoadObserver(AsWeakPtr(), host); | 514 new PortalFrameLoadObserver(AsWeakPtr(), host); |
515 } | 515 } |
OLD | NEW |