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/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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |