summaryrefslogtreecommitdiffstats
path: root/content/public
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-12 19:18:59 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-12 19:18:59 +0000
commit8aca725a07359b4eac2cce24990268ff10a2c755 (patch)
tree3a7e47dc5b120443ae4a76810d94bfcac5f4f381 /content/public
parentb67a44ea99660b674298c5e1f87a54ad8fe93e93 (diff)
downloadchromium_src-8aca725a07359b4eac2cce24990268ff10a2c755.zip
chromium_src-8aca725a07359b4eac2cce24990268ff10a2c755.tar.gz
chromium_src-8aca725a07359b4eac2cce24990268ff10a2c755.tar.bz2
Web MIDI: add RequestMIDISysExPermission to BrowserContext
Add RequestMIDISysExPermission to handle Web MIDI API permissions for system exclusive messages in content embedder. BUG=163795, 257618 TEST=none TBR=benm@chromium.org Review URL: https://chromiumcodereview.appspot.com/18647002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r--content/public/browser/browser_context.h15
-rw-r--r--content/public/test/test_browser_context.cc9
-rw-r--r--content/public/test/test_browser_context.h5
3 files changed, 25 insertions, 4 deletions
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index 1fb1052..c7b916f 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -44,10 +44,6 @@ class StoragePartition;
// thread.
class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
public:
- // Used in ForEachStoragePartition(). The first argument is the partition id.
- // The second argument is the StoragePartition object for that partition id.
- typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback;
-
static DownloadManager* GetDownloadManager(BrowserContext* browser_context);
// Returns BrowserContext specific external mount points. It may return NULL
@@ -59,6 +55,7 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
BrowserContext* browser_context, SiteInstance* site_instance);
static content::StoragePartition* GetStoragePartitionForSite(
BrowserContext* browser_context, const GURL& site);
+ typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback;
static void ForEachStoragePartition(
BrowserContext* browser_context,
const StoragePartitionCallback& callback);
@@ -128,6 +125,16 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
const base::FilePath& partition_path,
bool in_memory) = 0;
+ typedef base::Callback<void(bool)> MIDISysExPermissionCallback;
+
+ // Requests a permission to use system exclusive messages in MIDI events.
+ // |callback| will be invoked when the request is resolved.
+ virtual void RequestMIDISysExPermission(
+ int render_process_id,
+ int render_view_id,
+ const GURL& requesting_frame,
+ const MIDISysExPermissionCallback& callback) = 0;
+
// Returns the resource context.
virtual ResourceContext* GetResourceContext() = 0;
diff --git a/content/public/test/test_browser_context.cc b/content/public/test/test_browser_context.cc
index 05f40e8..3e909c2 100644
--- a/content/public/test/test_browser_context.cc
+++ b/content/public/test/test_browser_context.cc
@@ -99,6 +99,15 @@ TestBrowserContext::GetMediaRequestContextForStoragePartition(
return NULL;
}
+void TestBrowserContext::RequestMIDISysExPermission(
+ int render_process_id,
+ int render_view_id,
+ const GURL& requesting_frame,
+ const MIDISysExPermissionCallback& callback) {
+ // Always reject requests for testing.
+ callback.Run(false);
+}
+
ResourceContext* TestBrowserContext::GetResourceContext() {
if (!resource_context_)
resource_context_.reset(new MockResourceContext());
diff --git a/content/public/test/test_browser_context.h b/content/public/test/test_browser_context.h
index 2106938..e877059 100644
--- a/content/public/test/test_browser_context.h
+++ b/content/public/test/test_browser_context.h
@@ -40,6 +40,11 @@ class TestBrowserContext : public BrowserContext {
GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) OVERRIDE;
+ virtual void RequestMIDISysExPermission(
+ int render_process_id,
+ int render_view_id,
+ const GURL& requesting_frame,
+ const MIDISysExPermissionCallback& callback) OVERRIDE;
virtual ResourceContext* GetResourceContext() OVERRIDE;
virtual GeolocationPermissionContext*
GetGeolocationPermissionContext() OVERRIDE;