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 #include <string> |
9 #include <unordered_set> | 9 #include <unordered_set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 181 MdBookmarksUI::MdBookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
182 // Set up the chrome://bookmarks/ source. | 182 // Set up the chrome://bookmarks/ source. |
183 Profile* profile = Profile::FromWebUI(web_ui); | 183 Profile* profile = Profile::FromWebUI(web_ui); |
184 content::WebUIDataSource::Add(profile, | 184 content::WebUIDataSource::Add(profile, |
185 CreateMdBookmarksUIHTMLSource(profile)); | 185 CreateMdBookmarksUIHTMLSource(profile)); |
186 | 186 |
187 auto plural_string_handler = base::MakeUnique<PluralStringHandler>(); | 187 auto plural_string_handler = base::MakeUnique<PluralStringHandler>(); |
188 plural_string_handler->AddLocalizedString( | 188 plural_string_handler->AddLocalizedString( |
189 "toastItemsDeleted", IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_DELETED); | 189 "toastItemsDeleted", IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_DELETED); |
| 190 plural_string_handler->AddLocalizedString( |
| 191 "toastItemsCopied", IDS_MD_BOOKMARK_MANAGER_TOAST_ITEMS_COPIED); |
190 web_ui->AddMessageHandler(std::move(plural_string_handler)); | 192 web_ui->AddMessageHandler(std::move(plural_string_handler)); |
191 | 193 |
192 web_ui->AddMessageHandler(base::MakeUnique<BookmarksMessageHandler>()); | 194 web_ui->AddMessageHandler(base::MakeUnique<BookmarksMessageHandler>()); |
193 } | 195 } |
194 | 196 |
195 // static | 197 // static |
196 bool MdBookmarksUI::IsEnabled() { | 198 bool MdBookmarksUI::IsEnabled() { |
197 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks); | 199 return base::FeatureList::IsEnabled(features::kMaterialDesignBookmarks); |
198 } | 200 } |
OLD | NEW |