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

Unified Diff: chrome/browser/permissions/permission_request_manager.cc

Issue 2781803002: Don't delete the PermissionPromptAndroid when switching tabs (Closed)
Patch Set: . Created 3 years, 9 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 | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_request_manager.cc
diff --git a/chrome/browser/permissions/permission_request_manager.cc b/chrome/browser/permissions/permission_request_manager.cc
index 9b55f72a9fff48d800e995b4526b556d5fae94aa..35dc5ec81178ca42bd930191532b08c440efbb6b 100644
--- a/chrome/browser/permissions/permission_request_manager.cc
+++ b/chrome/browser/permissions/permission_request_manager.cc
@@ -82,7 +82,12 @@ PermissionRequestManager::PermissionRequestManager(
main_frame_has_fully_loaded_(false),
persist_(true),
auto_response_for_test_(NONE),
- weak_factory_(this) {}
+ weak_factory_(this) {
+#if defined(OS_ANDROID)
+ view_ = view_factory_.Run(web_contents);
+ view_->SetDelegate(this);
+#endif
+}
PermissionRequestManager::~PermissionRequestManager() {
if (view_ != NULL)
@@ -224,6 +229,11 @@ void PermissionRequestManager::CancelRequest(PermissionRequest* request) {
}
void PermissionRequestManager::HideBubble() {
+#if defined(ANDROID)
+ // The infobar system manages infobar lifetime and visibility so don't delete
+ // the PermissionPromptAndroid.
+ NOTREACHED();
+#else
// Disengage from the existing view if there is one.
if (!view_)
return;
@@ -231,6 +241,7 @@ void PermissionRequestManager::HideBubble() {
view_->SetDelegate(nullptr);
view_->Hide();
view_.reset();
+#endif
}
void PermissionRequestManager::DisplayPendingRequests() {
raymes 2017/04/03 04:28:25 I wonder if we should have NOTREACHED() here on An
raymes 2017/04/03 04:30:52 Another thought is that I wonder if in the long ru
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698