ThinWebView: Remove chrome layer dependency
This CL is a precursor to moving ThinWebView to components. Only
dependency on chrome layer was TabHelpers which was moved to a
ThinWebViewInitializer interface.
Bug: 1116770
Change-Id: I24fdd93e35ae24d9bede953e32c68b0fd7024ada
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358993
Commit-Queue: Shakti Sahu <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Cr-Commit-Position: refs/heads/master@{#799355}
diff --git a/chrome/browser/android/thin_webview/thin_webview_initializer.h b/chrome/browser/android/thin_webview/thin_webview_initializer.h
new file mode 100644
index 0000000..70b80c8
--- /dev/null
+++ b/chrome/browser/android/thin_webview/thin_webview_initializer.h
@@ -0,0 +1,35 @@
+// Copyright 2020 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_ANDROID_THIN_WEBVIEW_THIN_WEBVIEW_INITIALIZER_H_
+#define CHROME_BROWSER_ANDROID_THIN_WEBVIEW_THIN_WEBVIEW_INITIALIZER_H_
+
+#include "base/macros.h"
+
+namespace content {
+class WebContents;
+} // namespace content
+
+namespace thin_webview {
+namespace android {
+
+// A helper class to help in attaching tab helpers.
+class ThinWebViewInitializer {
+ public:
+ static void SetInstance(ThinWebViewInitializer* instance);
+ static ThinWebViewInitializer* GetInstance();
+
+ ThinWebViewInitializer() = default;
+ ~ThinWebViewInitializer() = default;
+
+ virtual void AttachTabHelpers(content::WebContents* web_contents) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ThinWebViewInitializer);
+};
+
+} // namespace android
+} // namespace thin_webview
+
+#endif // CHROME_BROWSER_ANDROID_THIN_WEBVIEW_THIN_WEBVIEW_INITIALIZER_H_