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

Unified Diff: ui/app_list/cocoa/apps_search_box_controller.mm

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove binary changes Created 7 years, 3 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: ui/app_list/cocoa/apps_search_box_controller.mm
diff --git a/ui/app_list/cocoa/apps_search_box_controller.mm b/ui/app_list/cocoa/apps_search_box_controller.mm
index 6d828bc7426e20e207a903cb74137748b2794fca..2c806324f8c1eabd28cb5f18256df6832f4ec61a 100644
--- a/ui/app_list/cocoa/apps_search_box_controller.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller.mm
@@ -10,7 +10,7 @@
#include "grit/ui_resources.h"
#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
#include "ui/app_list/app_list_menu.h"
-#import "ui/app_list/cocoa/current_user_menu_item_view.h"
+#include "ui/app_list/app_list_model.h"
#include "ui/app_list/search_box_model.h"
#include "ui/app_list/search_box_model_observer.h"
#import "ui/base/cocoa/controls/hover_image_menu_button.h"
@@ -177,7 +177,9 @@ void SearchBoxModelObserverBridge::TextChanged() {
if (![delegate_ appListDelegate])
return;
- appListMenu_.reset(new app_list::AppListMenu([delegate_ appListDelegate]));
+ appListMenu_.reset(
+ new app_list::AppListMenu([delegate_ appListDelegate],
+ [delegate_ appListModel]->users()));
[self rebuildMenu];
}
@@ -372,21 +374,6 @@ void SearchBoxModelObserverBridge::TextChanged() {
return self;
}
-- (void)addItemToMenu:(NSMenu*)menu
- atIndex:(NSInteger)index
- fromModel:(ui::MenuModel*)model {
- [super addItemToMenu:menu
- atIndex:index
- fromModel:model];
- if (model->GetCommandIdAt(index) != app_list::AppListMenu::CURRENT_USER)
- return;
-
- base::scoped_nsobject<NSView> customItemView([[CurrentUserMenuItemView alloc]
- initWithCurrentUser:[[searchBoxController_ delegate] currentUserName]
- userEmail:[[searchBoxController_ delegate] currentUserEmail]]);
- [[menu itemAtIndex:index] setView:customItemView];
-}
-
- (NSRect)confinementRectForMenu:(NSMenu*)menu
onScreen:(NSScreen*)screen {
NSPopUpButton* menuButton = [searchBoxController_ menuControl];
« no previous file with comments | « ui/app_list/cocoa/apps_search_box_controller.h ('k') | ui/app_list/cocoa/apps_search_box_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698