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

Unified Diff: chrome/browser/ui/webui/chromeos/cryptohome_ui.cc

Issue 10703162: chromeos: Remove CryptohomeLibrary::TpmGetPassword and TpmIsReady (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add cryptohome_web_ui_handler.cc/h Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/cryptohome_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc b/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..23e5fa55823eb9b63a6af5a2dc29beba05121efe
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
+#include "chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_ui.h"
+#include "grit/browser_resources.h"
+
+namespace chromeos {
+
+namespace {
+
+// Returns HTML data source for chrome://cryptohome.
+ChromeWebUIDataSource* CreateCryptohomeUIHTMLSource() {
+ ChromeWebUIDataSource* source =
+ new ChromeWebUIDataSource(chrome::kChromeUICryptohomeHost);
+ source->add_resource_path("cryptohome.js", IDR_CRYPTOHOME_JS);
+ source->set_default_resource(IDR_CRYPTOHOME_HTML);
+ return source;
+}
+
+} // namespace
+
+CryptohomeUI::CryptohomeUI(content::WebUI* web_ui) : WebUIController(web_ui) {
+ web_ui->AddMessageHandler(new CryptohomeWebUIHandler());
+
+ Profile* profile = Profile::FromWebUI(web_ui);
+ ChromeURLDataManager::AddDataSource(profile, CreateCryptohomeUIHTMLSource());
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698