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

Unified Diff: chrome/browser/ui/webui/about_page/about_page_ui.cc

Issue 9124028: separate about page into its own page (included in chrome://chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 11 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/about_page/about_page_ui.cc
diff --git a/chrome/browser/ui/webui/about_page/about_page_ui.cc b/chrome/browser/ui/webui/about_page/about_page_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9dc3b04cf2010e67459bb622652bdd439d6ba292
--- /dev/null
+++ b/chrome/browser/ui/webui/about_page/about_page_ui.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2011 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/about_page/about_page_ui.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/about_page/about_page_handler.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
+#include "chrome/browser/ui/webui/shared_resources_data_source.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_contents.h"
+#include "grit/browser_resources.h"
+
+namespace {
+
+ChromeWebUIDataSource* CreateAboutPageHTMLSource() {
+ ChromeWebUIDataSource* source =
+ new ChromeWebUIDataSource(chrome::kChromeUIAboutPageFrameHost);
+
+ source->set_json_path("strings.js");
+ source->add_resource_path("about_page.js", IDR_ABOUT_PAGE_JS);
+ source->set_default_resource(IDR_ABOUT_PAGE_HTML);
+ return source;
+}
+
+} // namespace
+
+AboutPageUI::AboutPageUI(content::WebContents* contents) : WebUI(contents) {
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
+ ChromeWebUIDataSource* source = CreateAboutPageHTMLSource();
+ profile->GetChromeURLDataManager()->AddDataSource(source);
+ profile->GetChromeURLDataManager()->AddDataSource(
+ new SharedResourcesDataSource());
+
+ AboutPageHandler* handler = new AboutPageHandler();
+ handler->GetLocalizedValues(source->localized_strings());
+ AddMessageHandler(handler);
+}
+
+AboutPageUI::~AboutPageUI() {
+}

Powered by Google App Engine
This is Rietveld 408576698