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

Issue 79773005: Update app list search box menu when Users changes (Closed)

Created:
7 years, 1 month ago by stevenjb
Modified:
7 years ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina
Visibility:
Public.

Description

Update app list search box menu when Users changes BUG=320409

Patch Set 1 #

Patch Set 2 : Add AppListViewDelegateObserver #

Total comments: 1

Patch Set 3 : Revert: Add AppListViewDelegateObserver #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M ui/app_list/views/search_box_view.cc View 2 1 chunk +2 lines, -2 lines 1 comment Download

Messages

Total messages: 11 (0 generated)
stevenjb
There are two patchsets here. The first one is a tiny change that should fix ...
7 years, 1 month ago (2013-11-21 19:43:34 UTC) #1
xiyuan
My preference is to move AppListMenu and user etc back into chrome side and expose ...
7 years, 1 month ago (2013-11-21 20:50:20 UTC) #2
koz (OOO until 15th September)
On 2013/11/21 20:50:20, xiyuan wrote: > My preference is to move AppListMenu and user etc ...
7 years, 1 month ago (2013-11-21 23:39:35 UTC) #3
tfarina
On Thu, Nov 21, 2013 at 9:39 PM, <koz@chromium.org> wrote: > I agree with Xiyuan, ...
7 years, 1 month ago (2013-11-21 23:41:42 UTC) #4
tapted
Still grokking.. we might be able to make `Users` a ui::ListModel<AppListViewDelegate::User> But, that might be ...
7 years, 1 month ago (2013-11-22 00:03:19 UTC) #5
benwells
On 2013/11/21 23:41:42, tfarina wrote: > On Thu, Nov 21, 2013 at 9:39 PM, <mailto:koz@chromium.org> ...
7 years, 1 month ago (2013-11-22 03:42:18 UTC) #6
tfarina
On Fri, Nov 22, 2013 at 1:42 AM, <benwells@chromium.org> wrote: > On 2013/11/21 23:41:42, tfarina ...
7 years, 1 month ago (2013-11-22 15:28:24 UTC) #7
stevenjb
I started separating Users into an AppListUserModel class and decided that I really didn't like ...
7 years, 1 month ago (2013-11-22 17:56:28 UTC) #8
xiyuan
LGTM On 2013/11/22 17:56:28, stevenjb wrote: > I started separating Users into an AppListUserModel class ...
7 years, 1 month ago (2013-11-22 18:07:59 UTC) #9
benwells
On 2013/11/22 18:07:59, xiyuan wrote: > LGTM > > On 2013/11/22 17:56:28, stevenjb wrote: > ...
7 years ago (2013-11-25 00:45:31 UTC) #10
tapted
7 years ago (2013-11-26 00:40:07 UTC) #11
https://codereview.chromium.org/79773005/diff/250001/ui/app_list/views/search...
File ui/app_list/views/search_box_view.cc (right):

https://codereview.chromium.org/79773005/diff/250001/ui/app_list/views/search...
ui/app_list/views/search_box_view.cc:190: // Always regenerate the menu in case
view_delegate_->GetUsers() has changed.
So, mac isn't affected by the checkmark-not-moving bug, but it is affected by
the "menu not updated when profile added/removed" bug.

Unfortunately Mac's menu_controller works a bit different -- an `NSMenu` is
populated and attached to the button itself, so I don't think there's a nice way
to intercept the 'click' the way you can for context menus.

But there is already an observer interface -- OnAppListModelSigninStatusChanged
-- which triggers a menu refresh. Hacky fix: just remove the `signed_in_ ==
signed_in` check from

void AppListModel::SetSignedIn(bool signed_in) {
  if (signed_in_ == signed_in)
    return;

/* .. */
}

I think this will fix Mac. Certainly, deleting a profile, then switching the app
launcher to a profile that isn't signed in and back will refresh the menu.

So, to make the fix less hacky, WDYT about just changing
`OnAppListModelSigninStatusChanged` to
`AppListModelObserver::OnAppListModelProfileChanged` ?

It looks like void AppListView::OnSigninStatusChanged() does
`app_list_main_view_->search_box_view()->InvalidateMenu();` so other platforms
should be covered too.

Powered by Google App Engine
This is Rietveld 408576698