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

Unified Diff: chrome/browser/resources/md_bookmarks/api_listener.js

Issue 2912893002: MD Bookmarks: Support policies for disabling bookmark editing (Closed)
Patch Set: canEdit -> globalCanEdit Created 3 years, 6 months 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/resources/md_bookmarks/api_listener.js
diff --git a/chrome/browser/resources/md_bookmarks/api_listener.js b/chrome/browser/resources/md_bookmarks/api_listener.js
index 0e54e07029f87e445662b7ee0f9938f500eb2493..d7907a48876efd49cc3c78c991206a40c6ea1934 100644
--- a/chrome/browser/resources/md_bookmarks/api_listener.js
+++ b/chrome/browser/resources/md_bookmarks/api_listener.js
@@ -85,6 +85,13 @@ cr.define('bookmarks.ApiListener', function() {
dispatch(bookmarks.actions.setIncognitoAvailability(availability));
}
+ /**
+ * @param {boolean} canEdit
+ */
+ function onCanEditBookmarksChanged(canEdit) {
+ dispatch(bookmarks.actions.setCanEditBookmarks(canEdit));
+ }
+
function init() {
chrome.bookmarks.onChanged.addListener(onBookmarkChanged);
chrome.bookmarks.onChildrenReordered.addListener(onChildrenReordered);
@@ -98,6 +105,10 @@ cr.define('bookmarks.ApiListener', function() {
.then(onIncognitoAvailabilityChanged);
cr.addWebUIListener(
'incognito-availability-changed', onIncognitoAvailabilityChanged);
+
+ cr.sendWithPromise('getCanEditBookmarks').then(onCanEditBookmarksChanged);
+ cr.addWebUIListener(
+ 'can-edit-bookmarks-changed', onCanEditBookmarksChanged);
}
return {
« no previous file with comments | « chrome/browser/resources/md_bookmarks/actions.js ('k') | chrome/browser/resources/md_bookmarks/command_manager.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698