| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h" | 5 #include "chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> |
| 8 | 9 |
| 9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/webui/md_bookmarks/bookmarks_message_handler.h" |
| 11 #include "chrome/common/chrome_features.h" | 13 #include "chrome/common/chrome_features.h" |
| 12 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 13 #include "chrome/grit/browser_resources.h" | 15 #include "chrome/grit/browser_resources.h" |
| 14 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 15 #include "components/strings/grit/components_strings.h" | 17 #include "components/strings/grit/components_strings.h" |
| 16 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.h" |
| 17 #include "content/public/browser/web_ui_data_source.h" | 19 #include "content/public/browser/web_ui_data_source.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return source; | 139 return source; |
| 138 } | 140 } |
| 139 | 141 |
| 140 } // namespace | 142 } // namespace |
| 141 | 143 |
| 142 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 144 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 143 // Set up the chrome://bookmarks/ source. | 145 // Set up the chrome://bookmarks/ source. |
| 144 Profile* profile = Profile::FromWebUI(web_ui); | 146 Profile* profile = Profile::FromWebUI(web_ui); |
| 145 content::WebUIDataSource::Add(profile, | 147 content::WebUIDataSource::Add(profile, |
| 146 CreateMdBookmarksUIHTMLSource(profile)); | 148 CreateMdBookmarksUIHTMLSource(profile)); |
| 149 |
| 150 web_ui->AddMessageHandler(base::MakeUnique<BookmarksMessageHandler>()); |
| 147 } | 151 } |
| 148 | 152 |
| 149 // static | 153 // static |
| 150 bool MdBookmarksUI::IsEnabled() { | 154 bool MdBookmarksUI::IsEnabled() { |
| 151 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks); | 155 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks); |
| 152 } | 156 } |
| OLD | NEW |