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

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: address comments 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
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..5f2970501295908937b3d092a85de622ff481cc6
--- /dev/null
+++ b/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
@@ -0,0 +1,47 @@
+// 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 "base/memory/ref_counted_memory.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 "chrome/grit/theme_resources.h"
+#include "components/strings/grit/components_strings.h"
+#include "content/public/browser/url_data_source.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "ui/base/resource/resource_bundle.h"
Dan Beam 2016/11/01 06:38:28 i don't think these are all needed
+
+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);
+}

Powered by Google App Engine
This is Rietveld 408576698