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

Unified Diff: chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc

Issue 2450623002: [MD Bookmarks] Add skeleton for Material Design Bookmarks (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
diff --git a/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..54397ca7d93cb8ddd614e9afec4b5f54287d1b1b
--- /dev/null
+++ b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2016 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/md_bookmarks/md_bookmarks_ui.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_features.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/grit/browser_resources.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/strings/grit/components_strings.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+namespace {
+
+content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIBookmarksHost);
+
+ // Localized strings (alphabetical order).
+ source->AddLocalizedString("title", IDS_BOOKMARK_MANAGER_TITLE);
+
+ source->SetDefaultResource(IDR_MD_BOOKMARKS_BOOKMARKS_HTML);
+ source->SetJsonPath("strings.js");
+
+ return source;
+}
+
+} // namespace
+
+MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
+ // Set up the chrome://bookmarks/ source.
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource::Add(profile,
+ CreateMdBookmarksUIHTMLSource(profile));
+}
+
+// static
+bool MdBookmarksUI::IsEnabled() {
+ return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks);
+}
« no previous file with comments | « chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698