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

Unified Diff: content/browser/service_worker/service_worker_version.cc

Issue 1411243012: Activate windows opened via Service Worker Clients.openWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.cc
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index bc88c065e538813c7b334d87e7820d3a723e7e41..93ae88445af6973f7ca40bb310856b6c2650c28f 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -236,6 +236,14 @@ class OpenURLObserver : public WebContentsObserver {
// This is only called for main frame navigations in OpenWindowOnUI().
void DidOpenURL(const OpenURLCallback& callback, WebContents* web_contents) {
DCHECK(web_contents);
+ WebContentsImpl* web_contents_impl =
+ static_cast<WebContentsImpl*>(web_contents);
+ // On Mac, if there are no Chrome windows open, ContentBrowserClient::OpenURL
+ // will call ui::BaseWindow::Show which opens a new window and makes it the
+ // main+key Chrome window, but won't raise it on top of other apps
+ // (https://crbug.com/470830). Since openWindow is always called from a user
+ // gesture (e.g. notification click), we should additionally raise the window.
+ web_contents_impl->Activate();
RenderFrameHostImpl* rfhi =
static_cast<RenderFrameHostImpl*>(web_contents->GetMainFrame());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698