| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 namespace chromeos { | 72 namespace chromeos { |
| 73 | 73 |
| 74 class SimUnlockUIHTMLSource : public ChromeURLDataManager::DataSource { | 74 class SimUnlockUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 75 public: | 75 public: |
| 76 SimUnlockUIHTMLSource(); | 76 SimUnlockUIHTMLSource(); |
| 77 | 77 |
| 78 // Called when the network layer has requested a resource underneath | 78 // Called when the network layer has requested a resource underneath |
| 79 // the path we registered. | 79 // the path we registered. |
| 80 virtual void StartDataRequest(const std::string& path, | 80 virtual void StartDataRequest(const std::string& path, |
| 81 bool is_incognito, | 81 bool is_incognito, |
| 82 int request_id); | 82 int request_id) OVERRIDE; |
| 83 virtual std::string GetMimeType(const std::string&) const { | 83 virtual std::string GetMimeType(const std::string&) const OVERRIDE { |
| 84 return "text/html"; | 84 return "text/html"; |
| 85 } | 85 } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 virtual ~SimUnlockUIHTMLSource() {} | 88 virtual ~SimUnlockUIHTMLSource() {} |
| 89 | 89 |
| 90 std::string service_path_; | 90 std::string service_path_; |
| 91 DISALLOW_COPY_AND_ASSIGN(SimUnlockUIHTMLSource); | 91 DISALLOW_COPY_AND_ASSIGN(SimUnlockUIHTMLSource); |
| 92 }; | 92 }; |
| 93 | 93 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 SimUnlockHandler* handler = new SimUnlockHandler(); | 673 SimUnlockHandler* handler = new SimUnlockHandler(); |
| 674 web_ui->AddMessageHandler(handler); | 674 web_ui->AddMessageHandler(handler); |
| 675 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); | 675 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); |
| 676 | 676 |
| 677 // Set up the chrome://sim-unlock/ source. | 677 // Set up the chrome://sim-unlock/ source. |
| 678 Profile* profile = Profile::FromWebUI(web_ui); | 678 Profile* profile = Profile::FromWebUI(web_ui); |
| 679 ChromeURLDataManager::AddDataSource(profile, html_source); | 679 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 680 } | 680 } |
| 681 | 681 |
| 682 } // namespace chromeos | 682 } // namespace chromeos |
| OLD | NEW |