OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // This interface provides functions for querying instance state for resource |
| 14 // host implementations. It allows us to mock out some of these interactions |
| 15 // for testing, as well as limit the dependencies on the webkit layer. |
| 16 class PepperInstanceStateAccessor { |
| 17 public: |
| 18 virtual ~PepperInstanceStateAccessor() {} |
| 19 |
| 20 // Returns true if the given instance is valid for the host. |
| 21 virtual bool IsValidInstance(PP_Instance instance) = 0; |
| 22 |
| 23 // Returns true if the given instance is considered to be currently |
| 24 // processing a user gesture or the plugin module has the "override user |
| 25 // gesture" flag set (in which case it can always do things normally |
| 26 // restricted by user gestures). Returns false if the instance is invalid or |
| 27 // if there is no current user gesture. |
| 28 virtual bool HasUserGesture(PP_Instance instance) = 0; |
| 29 }; |
| 30 |
| 31 } // namespace content |
| 32 |
| 33 #endif // CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_H_ |
OLD | NEW |