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

Issue 2939943004: Fix duplicate logging of ActiveBrowserChanged action on views. (Closed)

Created:
3 years, 6 months ago by Alexei Svitkine (slow)
Modified:
3 years, 5 months ago
Reviewers:
Peter Kasting, rkaplow
CC:
chromium-reviews, tfarina, rkaplow
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix duplicate logging of ActiveBrowserChanged action on views. This was caused by redundant calls to BrowserList::SetLastActive, one from BrowserFrame and another from BrowserView: views::DesktopNativeWidgetAura::HandleActivationChanged() BrowserFrame::OnNativeWidgetActivationChanged() BrowserList::SetLastActive() and: views::DesktopNativeWidgetAura::HandleActivationChanged() BrowserFrame::OnNativeWidgetActivationChanged() views::Widget::OnNativeWidgetActivationChanged() BrowserView::OnWidgetActivationChanged() BrowserList::SetLastActive() The change removes the call from BrowserFrame since it seems redundant with the one in BrowserView which observes its widget (via GetWidget()->AddObserver(this) call in InitViews()), so it will always get the OnWidgetActivationChanged() notifications - and it needs them for other things already. Also fixes ChromeVisibilityObserverBrowserTest on Windows which was fragile to the ordering of active/inactive events (and just happened to work due to the duplicate events). That test was also made unnecessarily complex by https://codereview.chromium.org/2591783002 so this change reverts most of that CL and simplifies things via RunLoop::RunUntilIdle(). BUG=689553 TEST=Open two windows and then load chrome://user-actions. Switch windows and observe only a single instance of ActiveBrowserChanged logged per window switch. Review-Url: https://codereview.chromium.org/2939943004 Cr-Commit-Position: refs/heads/master@{#483695} Committed: https://chromium.googlesource.com/chromium/src/+/ba8e10dc8119f1bd7d2f365b2b3078f68aeb16cf

Patch Set 1 #

Patch Set 2 : Fix ChromeVisibilityObserverBrowserTest on windows. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -56 lines) Patch
M chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer.h View 1 2 chunks +1 line, -4 lines 0 comments Download
M chrome/browser/metrics/desktop_session_duration/chrome_visibility_observer_browsertest.cc View 1 2 chunks +11 lines, -36 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_frame.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_frame.cc View 1 chunk +0 lines, -15 lines 0 comments Download

Messages

Total messages: 26 (19 generated)
Alexei Svitkine (slow)
3 years, 6 months ago (2017-06-15 17:42:08 UTC) #4
Alexei Svitkine (slow)
Actually, please hold off on this review. Looks like there's a problem with ChromeVisibilityObserverBrowserTest.VisibilityTest on ...
3 years, 6 months ago (2017-06-15 19:35:54 UTC) #7
Alexei Svitkine (slow)
Okay, this is ready for review again! pkasting: please review chrome/browser/ui rkaplow: please review chrome/browser/metrics
3 years, 5 months ago (2017-06-29 20:18:31 UTC) #17
Peter Kasting
LGTM
3 years, 5 months ago (2017-06-29 20:25:51 UTC) #20
rkaplow
lgtm
3 years, 5 months ago (2017-06-30 13:56:10 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2939943004/40001
3 years, 5 months ago (2017-06-30 14:15:51 UTC) #23
commit-bot: I haz the power
3 years, 5 months ago (2017-06-30 14:21:12 UTC) #26
Message was sent while issue was closed.
Committed patchset #2 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/ba8e10dc8119f1bd7d2f365b2b30...

Powered by Google App Engine
This is Rietveld 408576698