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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2142983002: Add desktop engagement metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 0f9b7296a03c4420f1671ce6bcc379ce44020d32..f25a5c79f31576a63a6c6a111c209cb317c02608 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -598,9 +598,10 @@ bool IsTabDetachingInFullscreenEnabled() {
// Called right after our window became the main window.
- (void)windowDidBecomeMain:(NSNotification*)notification {
- if (chrome::GetLastActiveBrowser() != browser_.get()) {
- BrowserList::SetLastActive(browser_.get());
- }
+ // Set this window as active even if the previously active windows was the
Lei Zhang 2016/08/01 17:29:02 Funny enough, before https://codereview.chromium.o
gayane -on leave until 09-2017 2016/08/02 17:13:44 Yes, there is also this CL https://codereview.chro
+ // same one. This is needed for tracking visibility changes of a browser.
+ BrowserList::SetLastActive(browser_.get());
+
// Always saveWindowPositionIfNeeded when becoming main, not just
// when |browser_| is not the last active browser. See crbug.com/536280 .
[self saveWindowPositionIfNeeded];
@@ -624,6 +625,8 @@ bool IsTabDetachingInFullscreenEnabled() {
extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile())
->set_registry_for_active_window(nullptr);
+
+ BrowserList::NotifyBrowserNoLongerActive(browser_.get());
}
// Called when we have been minimized.

Powered by Google App Engine
This is Rietveld 408576698