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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm

Issue 769153007: Managed bookmarks for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build (Android & unit_tests) Created 5 years, 10 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
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
index 00915f8ec7725baf5d2c33df3e5ed70a012b397c..ef810682151951e6a12aa6f6c100fc459b722c89 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -74,13 +74,14 @@ void BookmarkMenuBridge::UpdateMenuInternal(NSMenu* bookmark_menu,
ClearBookmarkMenu(bookmark_menu);
- // Add at most one separator for the bookmark bar and the managed bookmarks
- // folder.
+ // Add at most one separator for the bookmark bar and the managed and
+ // supervised bookmarks folders.
ChromeBookmarkClient* client =
ChromeBookmarkClientFactory::GetForProfile(profile_);
const BookmarkNode* barNode = model->bookmark_bar_node();
const BookmarkNode* managedNode = client->managed_node();
- if (!barNode->empty() || !managedNode->empty())
+ const BookmarkNode* supervisedNode = client->supervised_node();
+ if (!barNode->empty() || !managedNode->empty() || !supervisedNode->empty())
[bookmark_menu addItem:[NSMenuItem separatorItem]];
if (!managedNode->empty()) {
// Most users never see this node, so the image is only loaded if needed.
@@ -89,6 +90,13 @@ void BookmarkMenuBridge::UpdateMenuInternal(NSMenu* bookmark_menu,
rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER_MANAGED).ToNSImage();
AddNodeAsSubmenu(bookmark_menu, managedNode, image, !is_submenu);
}
+ if (!supervisedNode->empty()) {
+ // Most users never see this node, so the image is only loaded if needed.
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ NSImage* image =
+ rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER_SUPERVISED).ToNSImage();
+ AddNodeAsSubmenu(bookmark_menu, supervisedNode, image, !is_submenu);
+ }
if (!barNode->empty())
AddNodeToMenu(barNode, bookmark_menu, !is_submenu);
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698