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

Side by Side Diff: chrome/browser/ui/webui/chromeos/sim_unlock_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/sim_unlock_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 } // namespace 70 } // namespace
71 71
72 namespace chromeos { 72 namespace chromeos {
73 73
74 class SimUnlockUIHTMLSource : public content::URLDataSource { 74 class SimUnlockUIHTMLSource : public content::URLDataSource {
75 public: 75 public:
76 SimUnlockUIHTMLSource(); 76 SimUnlockUIHTMLSource();
77 77
78 // content::URLDataSource implementation. 78 // content::URLDataSource implementation.
79 virtual std::string GetSource() OVERRIDE; 79 virtual std::string GetSource() const OVERRIDE;
80 virtual void StartDataRequest( 80 virtual void StartDataRequest(
81 const std::string& path, 81 const std::string& path,
82 bool is_incognito, 82 bool is_incognito,
83 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; 83 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
84 virtual std::string GetMimeType(const std::string&) const OVERRIDE { 84 virtual std::string GetMimeType(const std::string&) const OVERRIDE {
85 return "text/html"; 85 return "text/html";
86 } 86 }
87 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE { 87 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE {
88 return false; 88 return false;
89 } 89 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 bool pending_pin_operation_; 246 bool pending_pin_operation_;
247 247
248 DISALLOW_COPY_AND_ASSIGN(SimUnlockHandler); 248 DISALLOW_COPY_AND_ASSIGN(SimUnlockHandler);
249 }; 249 };
250 250
251 // SimUnlockUIHTMLSource ------------------------------------------------------- 251 // SimUnlockUIHTMLSource -------------------------------------------------------
252 252
253 SimUnlockUIHTMLSource::SimUnlockUIHTMLSource() { 253 SimUnlockUIHTMLSource::SimUnlockUIHTMLSource() {
254 } 254 }
255 255
256 std::string SimUnlockUIHTMLSource::GetSource() { 256 std::string SimUnlockUIHTMLSource::GetSource() const {
257 return chrome::kChromeUISimUnlockHost; 257 return chrome::kChromeUISimUnlockHost;
258 } 258 }
259 259
260 void SimUnlockUIHTMLSource::StartDataRequest( 260 void SimUnlockUIHTMLSource::StartDataRequest(
261 const std::string& path, 261 const std::string& path,
262 bool is_incognito, 262 bool is_incognito,
263 const content::URLDataSource::GotDataCallback& callback) { 263 const content::URLDataSource::GotDataCallback& callback) {
264 DictionaryValue strings; 264 DictionaryValue strings;
265 strings.SetString("title", 265 strings.SetString("title",
266 l10n_util::GetStringUTF16(IDS_SIM_UNLOCK_ENTER_PIN_TITLE)); 266 l10n_util::GetStringUTF16(IDS_SIM_UNLOCK_ENTER_PIN_TITLE));
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 SimUnlockHandler* handler = new SimUnlockHandler(); 680 SimUnlockHandler* handler = new SimUnlockHandler();
681 web_ui->AddMessageHandler(handler); 681 web_ui->AddMessageHandler(handler);
682 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); 682 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
683 683
684 // Set up the chrome://sim-unlock/ source. 684 // Set up the chrome://sim-unlock/ source.
685 Profile* profile = Profile::FromWebUI(web_ui); 685 Profile* profile = Profile::FromWebUI(web_ui);
686 content::URLDataSource::Add(profile, html_source); 686 content::URLDataSource::Add(profile, html_source);
687 } 687 }
688 688
689 } // namespace chromeos 689 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc ('k') | chrome/browser/ui/webui/chromeos/system_info_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698