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

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: string change Created 5 years, 11 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/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 e0f938bc6f47cf633993b3ed8de74e9c645899a1..7392e84e153f8d5f32f212a9ff51ead74de894ab 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -73,13 +73,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.
@@ -88,6 +89,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);

Powered by Google App Engine
This is Rietveld 408576698