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

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

Issue 13945023: Make URLDataSource::GetSource() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another one. Created 7 years, 8 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 #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
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/bookmarks_ui.cc ('k') | chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698