Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "base/memory/ref_counted_memory.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "chrome/common/chrome_features.h" | |
| 10 #include "chrome/common/url_constants.h" | |
| 11 #include "chrome/grit/browser_resources.h" | |
| 12 #include "chrome/grit/generated_resources.h" | |
| 13 #include "chrome/grit/theme_resources.h" | |
| 14 #include "components/strings/grit/components_strings.h" | |
| 15 #include "content/public/browser/url_data_source.h" | |
| 16 #include "content/public/browser/web_ui.h" | |
| 17 #include "content/public/browser/web_ui_data_source.h" | |
| 18 #include "ui/base/resource/resource_bundle.h" | |
|
Dan Beam
2016/11/01 06:38:28
i don't think these are all needed
| |
| 19 | |
| 20 namespace { | |
| 21 | |
| 22 content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) { | |
| 23 content::WebUIDataSource* source = | |
| 24 content::WebUIDataSource::Create(chrome::kChromeUIBookmarksHost); | |
| 25 | |
| 26 // Localized strings (alphabetical order). | |
| 27 source->AddLocalizedString("title", IDS_BOOKMARK_MANAGER_TITLE); | |
| 28 | |
| 29 source->SetDefaultResource(IDR_MD_BOOKMARKS_BOOKMARKS_HTML); | |
| 30 source->SetJsonPath("strings.js"); | |
| 31 | |
| 32 return source; | |
| 33 } | |
| 34 | |
| 35 } // namespace | |
| 36 | |
| 37 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { | |
| 38 // Set up the chrome://bookmarks/ source. | |
| 39 Profile* profile = Profile::FromWebUI(web_ui); | |
| 40 content::WebUIDataSource::Add(profile, | |
| 41 CreateMdBookmarksUIHTMLSource(profile)); | |
| 42 } | |
| 43 | |
| 44 // static | |
| 45 bool MdBookmarksUI::IsEnabled() { | |
| 46 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks); | |
| 47 } | |
| OLD | NEW |