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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 23128005: Bring windows with new tabs to foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit tests. Created 7 years, 4 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 | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/background.js
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index fdeee8ca3b63bc48b0330017360cd6cc5836da9c..c6e38f24bb517ba3b2bf169b35fc144d176e159a 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -604,8 +604,10 @@ function onNotificationClicked(notificationId, selector) {
return;
instrumented.tabs.create({url: url}, function(tab) {
- if (!tab)
- chrome.windows.create({url: url});
+ if (tab)
+ chrome.windows.update(tab.windowId, {focused: true});
+ else
+ chrome.windows.create({url: url, focused: true});
});
});
}
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698