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

Side by Side Diff: chrome/browser/ui/blocked_content/app_modal_dialog_helper.cc

Issue 1153813003: Add user_gesture param to WebContentsDelegate::ActivateContents Base URL: https://chromium.googlesource.com/chromium/src.git@ug1_WebContentsImpl_Activate
Patch Set: Update callers Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h" 5 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_finder.h" 8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/browser_list.h" 9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 16 matching lines...) Expand all
27 active_web_contents->GetOpener() == dialog_host) { 27 active_web_contents->GetOpener() == dialog_host) {
28 // It's indeed a popup from the dialog opening WebContents. Store it, so 28 // It's indeed a popup from the dialog opening WebContents. Store it, so
29 // we can focus it later. 29 // we can focus it later.
30 popup_ = active_web_contents; 30 popup_ = active_web_contents;
31 Observe(popup_); 31 Observe(popup_);
32 } 32 }
33 } 33 }
34 } 34 }
35 35
36 AppModalDialogHelper::~AppModalDialogHelper() { 36 AppModalDialogHelper::~AppModalDialogHelper() {
37 // TODO(johnme): Can we sometimes be certain this was for a user gesture?
37 if (popup_) 38 if (popup_)
38 popup_->GetDelegate()->ActivateContents(popup_); 39 popup_->GetDelegate()->ActivateContents(popup_, false /* user_gesture */);
39 } 40 }
40 41
41 void AppModalDialogHelper::WebContentsDestroyed() { 42 void AppModalDialogHelper::WebContentsDestroyed() {
42 popup_ = nullptr; 43 popup_ = nullptr;
43 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/javascript_app_modal_dialog_android.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698