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

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

Issue 2666523002: Allow permission bubbles to participate in key event dispatch as if they were a Browser. (Closed)
Patch Set: comments, fix permission->type missed in a refactor Created 3 years, 11 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_request_manager_test_api.h
diff --git a/chrome/browser/permissions/permission_request_manager_test_api.h b/chrome/browser/permissions/permission_request_manager_test_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed68c301cff8a1da7fe1e8eab6b1bcbeefaf3501
--- /dev/null
+++ b/chrome/browser/permissions/permission_request_manager_test_api.h
@@ -0,0 +1,44 @@
+// Copyright 2017 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_REQUEST_MANAGER_TEST_API_H_
+#define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_TEST_API_H_
+
+#include "base/macros.h"
+#include "chrome/browser/permissions/permission_request_manager.h"
+#include "content/public/browser/permission_type.h"
+
+class Browser;
+class Profile;
+
+namespace test {
+
+class PermissionRequestManagerTestApi {
+ public:
+ explicit PermissionRequestManagerTestApi(PermissionRequestManager* manager);
+
+ // Wraps the PermissionRequestManager for the active tab in |browser|.
+ explicit PermissionRequestManagerTestApi(Browser* browser);
+
+ PermissionRequestManager* manager() { return manager_; }
+
+ // Add a "simple" permission request. One that uses PermissionRequestImpl,
+ // such as for content::PermissionType including MIDI_SYSEX, PUSH_MESSAGING,
+ // NOTIFICATIONS, GEOLOCATON, or FLASH. This can be called multiple times
+ // before a call to manager()->DisplayPendingRequests().
+ void AddSimpleRequest(Profile* profile, content::PermissionType type);
+
+ // Return the bubble window for the permission prompt or null if there is no
+ // prompt currently showing.
+ gfx::NativeWindow GetPromptWindow();
+
+ private:
+ PermissionRequestManager* manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionRequestManagerTestApi);
+};
+
+} // namespace test
+
+#endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_TEST_API_H_

Powered by Google App Engine
This is Rietveld 408576698