Index: components/web_restrictions/browser/mock_web_restrictions_client.h |
diff --git a/components/web_restrictions/browser/mock_web_restrictions_client.h b/components/web_restrictions/browser/mock_web_restrictions_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..92b945fdbc3452b087be91c795e973fd18fe3a4a |
--- /dev/null |
+++ b/components/web_restrictions/browser/mock_web_restrictions_client.h |
@@ -0,0 +1,30 @@ |
+// 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 COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_ |
+#define COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_ |
+ |
+#include "base/macros.h" |
+#include "jni/MockWebRestrictionsClient_jni.h" |
+ |
+namespace web_restrictions { |
+ |
+// This is a wrapper for the Java MockWebRestrictionsClient. |
+class MockWebRestrictionsClient { |
+ public: |
+ MockWebRestrictionsClient() { |
Bernhard Bauer
2016/02/23 14:29:13
Usually, these method bodies should be out of line
aberent
2016/02/23 16:26:51
Done.
|
+ Java_MockWebRestrictionsClient_registerAsMockForTesting( |
+ base::android::AttachCurrentThread()); |
+ } |
+ |
+ ~MockWebRestrictionsClient() { |
+ Java_MockWebRestrictionsClient_unregisterAsMockForTesting( |
+ base::android::AttachCurrentThread()); |
+ } |
+ |
+ static bool Register(JNIEnv* env) { return RegisterNativesImpl(env); } |
+}; |
+ |
+} // namespace web_restrictions |
+#endif // COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_ |