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

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

Issue 2315563002: Add PermissionPromptAndroid skeleton (Closed)
Patch Set: update Created 4 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
Index: chrome/browser/permissions/permission_prompt_android.h
diff --git a/chrome/browser/permissions/permission_prompt_android.h b/chrome/browser/permissions/permission_prompt_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..70334e6553c3f9acd4e7cd96467dd3ee1faf1648
--- /dev/null
+++ b/chrome/browser/permissions/permission_prompt_android.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_
+#define CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_
+
+#include "chrome/browser/ui/website_settings/permission_prompt.h"
+
+class GroupedPermissionInfoBarDelegate;
+class InfoBarService;
+
+namespace content {
+class WebContents;
+}
+
+namespace infobars {
+class InfoBar;
+}
+
+class PermissionPromptAndroid : public PermissionPrompt {
+ public:
+ explicit PermissionPromptAndroid(content::WebContents* web_contents);
+ ~PermissionPromptAndroid() override;
+
+ // PermissionPrompt:
+ void SetDelegate(Delegate* delegate) override;
+ void Show(const std::vector<PermissionRequest*>& requests,
+ const std::vector<bool>& accept_state) override;
+ bool CanAcceptRequestUpdate() override;
+ void Hide() override;
+ bool IsVisible() override;
+ void UpdateAnchorPosition() override;
+ gfx::NativeWindow GetNativeWindow() override;
+
+ void Closing();
+
+ private:
+ // PermissionPromptAndroid is owned by PermissionRequestManager, so it should
+ // be safe to hold a raw WebContents pointer here because this class is
+ // destroyed before the WebContents.
+ content::WebContents* web_contents_;
+ // |delegate_| is the PermissionRequestManager, which owns this object.
+ Delegate* delegate_;
+ // |infobar_| is owned by the InfoBarService; we keep a pointer here so we can
+ // ask the service to remove the infobar after it is added.
+ infobars::InfoBar* infobar_;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionPromptAndroid);
+};
+
+#endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698