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

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

Issue 23766018: Based off 20656002 Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: compiles on mac, tests "pass", but Menu is wrong 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
« no previous file with comments | « ui/app_list/app_list_model.cc ('k') | ui/app_list/cocoa/apps_grid_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/cocoa/app_list_view_controller.mm
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index 5b36f4e71ebecf0d8752ab8b7309f4087e79986f..90dcc623f483224d1e2f8c790dd5720dc1b739ef 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -43,6 +43,16 @@ const CGFloat kMaxSegmentWidth = 80;
// Duration of the animation for sliding in and out search results.
const NSTimeInterval kResultsAnimationDuration = 0.2;
+app_list::AppListModel::User* CurrentUser(app_list::AppListModel* model) {
+ app_list::AppListModel::Users::const_iterator it = model->users().begin();
+ for (; it != model->users().end(); ++it) {
+ if ((*it)->active)
+ return *it;
+ }
+ NOTREACHED();
+ return NULL;
+}
+
} // namespace
@interface BackgroundView : FlippedView;
@@ -88,7 +98,7 @@ class AppListModelObserverBridge : public AppListModelObserver {
private:
// Overridden from app_list::AppListModelObserver:
- virtual void OnAppListModelCurrentUserChanged() OVERRIDE;
+ virtual void OnAppListModelUsersChanged() OVERRIDE;
virtual void OnAppListModelSigninStatusChanged() OVERRIDE;
AppListViewController* parent_; // Weak. Owns us.
@@ -106,7 +116,7 @@ AppListModelObserverBridge::~AppListModelObserverBridge() {
[[parent_ appsGridController] model]->RemoveObserver(this);
}
-void AppListModelObserverBridge::OnAppListModelCurrentUserChanged() {
+void AppListModelObserverBridge::OnAppListModelUsersChanged() {
[parent_ onSigninStatusChanged];
}
@@ -324,12 +334,12 @@ void AppListModelObserverBridge::OnAppListModelSigninStatusChanged() {
- (NSString*)currentUserName {
return base::SysUTF16ToNSString(
- [appsGridController_ model]->current_user_name());
+ CurrentUser([appsGridController_ model])->name);
}
- (NSString*)currentUserEmail {
return base::SysUTF16ToNSString(
- [appsGridController_ model]->current_user_email());
+ CurrentUser([appsGridController_ model])->email);
}
- (void)openResult:(app_list::SearchResult*)result {
« no previous file with comments | « ui/app_list/app_list_model.cc ('k') | ui/app_list/cocoa/apps_grid_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698