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

Unified Diff: chrome/browser/permissions/permission_dialog_delegate.h

Issue 2538253002: Don't show a modal permission prompt if the requesting WebContents has no tab. (Closed)
Patch Set: Created 4 years 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/permissions/permission_dialog_delegate.h
diff --git a/chrome/browser/permissions/permission_dialog_delegate.h b/chrome/browser/permissions/permission_dialog_delegate.h
index 57d9be5fc180d061d7218c38ce1a4212d8556063..96a4347ab5f3e7ee2d0aa67cc26878ab6df0ea6e 100644
--- a/chrome/browser/permissions/permission_dialog_delegate.h
+++ b/chrome/browser/permissions/permission_dialog_delegate.h
@@ -12,7 +12,6 @@
#include "base/macros.h"
#include "chrome/browser/permissions/permission_util.h"
#include "content/public/browser/permission_type.h"
-#include "content/public/browser/web_contents_observer.h"
using base::android::JavaParamRef;
using base::android::ScopedJavaLocalRef;
@@ -25,6 +24,7 @@ class MediaStreamDevicesController;
class GURL;
class PermissionInfoBarDelegate;
class Profile;
+class TabAndroid;
// Delegate class for displaying a permission prompt as a modal dialog. Used as
// the native to Java interface to allow Java to communicate the user's
@@ -35,7 +35,7 @@ class Profile;
// GroupedPermissionInfoBarDelegate, which will then source all of its data from
// an underlying PermissionPromptAndroid object. At that time, this class will
// also change to wrap a PermissionPromptAndroid.
-class PermissionDialogDelegate : content::WebContentsObserver {
+class PermissionDialogDelegate {
public:
using PermissionSetCallback = base::Callback<void(bool, PermissionAction)>;
@@ -72,12 +72,14 @@ class PermissionDialogDelegate : content::WebContentsObserver {
private:
PermissionDialogDelegate(
- content::WebContents* web_contents,
+ TabAndroid* tab,
std::unique_ptr<PermissionInfoBarDelegate> infobar_delegate_);
- ~PermissionDialogDelegate() override;
+ ~PermissionDialogDelegate();
ScopedJavaLocalRef<jobject> CreateJavaDelegate(JNIEnv* env);
+ TabAndroid* tab_;
+
// The InfoBarDelegate which this class is wrapping.
// TODO(dominickn,lshang) replace this with PermissionPromptAndroid as the
// permission prompt refactoring continues.

Powered by Google App Engine
This is Rietveld 408576698