Index: content/renderer/pepper/content_instance_glue.h |
diff --git a/content/renderer/pepper/content_instance_glue.h b/content/renderer/pepper/content_instance_glue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d93454e82b57d1a675fe44416b98dcc3fa75cfd |
--- /dev/null |
+++ b/content/renderer/pepper/content_instance_glue.h |
@@ -0,0 +1,33 @@ |
+// Copyright (c) 2012 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 CONTENT_RENDERER_PEPPER_CONTENT_INSTANCE_GLUE_H_ |
+#define CONTENT_RENDERER_PEPPER_CONTENT_INSTANCE_GLUE_H_ |
+ |
+#include "base/basictypes.h" |
+#include "ppapi/c/pp_instance.h" |
+ |
+namespace content { |
+ |
+// This interface provides functions for querying instance state for resource |
+// host implementations. It allows us to mock out some of these interactions |
+// for testing, as well as limit the dependencies on the webkit layer. |
+class ContentInstanceGlue { |
bbudge
2012/07/09 20:41:36
Can you come up with a better name for this? Also,
|
+ public: |
+ virtual ~ContentInstanceGlue() {} |
+ |
+ // Returns true if the given instance is valid for the host. |
+ virtual bool IsValidInstance(PP_Instance instance) = 0; |
+ |
+ // Returns true if the given instance is considered to be currently |
+ // processing a user gesture or the plugin module has the "override user |
+ // gesture" flag set (in which case it can always do things normally |
+ // restricted by user gestures). Returns false if the instance is invalid or |
+ // if there is no current user gesture. |
+ virtual bool HasUserGesture(PP_Instance instance) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_PEPPER_CONTENT_INSTANCE_GLUE_H_ |