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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/common/chrome_features.h"
9 #include "chrome/common/url_constants.h"
10 #include "chrome/grit/browser_resources.h"
11 #include "chrome/grit/generated_resources.h"
12 #include "components/strings/grit/components_strings.h"
13 #include "content/public/browser/web_ui.h"
14 #include "content/public/browser/web_ui_data_source.h"
15
16 namespace {
17
18 content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
19 content::WebUIDataSource* source =
20 content::WebUIDataSource::Create(chrome::kChromeUIBookmarksHost);
21
22 // Localized strings (alphabetical order).
23 source->AddLocalizedString("title", IDS_BOOKMARK_MANAGER_TITLE);
24
25 source->SetDefaultResource(IDR_MD_BOOKMARKS_BOOKMARKS_HTML);
26 source->SetJsonPath("strings.js");
27
28 return source;
29 }
30
31 } // namespace
32
33 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
34 // Set up the chrome://bookmarks/ source.
35 Profile* profile = Profile::FromWebUI(web_ui);
36 content::WebUIDataSource::Add(profile,
37 CreateMdBookmarksUIHTMLSource(profile));
38 }
39
40 // static
41 bool MdBookmarksUI::IsEnabled() {
42 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks);
43 }
OLDNEW
« 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