OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file.#ifndef WebViewBase_h | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebLocalFrameBase_h | 5 #ifndef WebLocalFrameBase_h |
6 #define WebLocalFrameBase_h | 6 #define WebLocalFrameBase_h |
7 | 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "public/platform/WebCommon.h" |
8 #include "public/web/WebLocalFrame.h" | 10 #include "public/web/WebLocalFrame.h" |
9 | 11 |
10 namespace blink { | 12 namespace blink { |
11 | 13 |
| 14 class LocalFrame; |
| 15 |
12 // WebLocalFrameBase is a temporary class the provides a layer of abstraction | 16 // WebLocalFrameBase is a temporary class the provides a layer of abstraction |
13 // for WebLocalFrameImpl. Mehtods that are declared public in WebLocalFrameImpl | 17 // for WebLocalFrameImpl. Mehtods that are declared public in WebLocalFrameImpl |
14 // that are not overrides from WebLocalFrame will be declared pure virtual in | 18 // that are not overrides from WebLocalFrame will be declared pure virtual in |
15 // WebLocalFrameBase. Classes that then have a dependency on WebLocalFrameImpl | 19 // WebLocalFrameBase. Classes that then have a dependency on WebLocalFrameImpl |
16 // will then take a dependency on WebLocalFrameBase instead, so we can remove | 20 // will then take a dependency on WebLocalFrameBase instead, so we can remove |
17 // cyclic dependencies in web/ and move classes from web/ into core/ or | 21 // cyclic dependencies in web/ and move classes from web/ into core/ or |
18 // modules. | 22 // modules. |
19 // TODO(slangley): Remove this class once WebLocalFrameImpl is in core/. | 23 // TODO(slangley): Remove this class once WebLocalFrameImpl is in core/. |
20 class WebLocalFrameBase : public WebLocalFrame { | 24 class WebLocalFrameBase : public WebLocalFrame { |
| 25 public: |
| 26 // Creation Methods. |
| 27 CORE_EXPORT static WebLocalFrameBase* FromFrame(LocalFrame*); |
| 28 CORE_EXPORT static WebLocalFrameBase* FromFrame(LocalFrame&); |
| 29 |
| 30 // WebLocalFrame creation callbacks. These callbacks provide the means to |
| 31 // keep WebLocalFrameBase separate from WebLocalFrameImpl. On process |
| 32 // initialization it is expected that the correct callbacks are registered |
| 33 // so that WebLocalFrameBase can instantiate the concrete class. |
| 34 using CreateFromLocalFramePtrCallback = WebLocalFrameBase* (*)(LocalFrame*); |
| 35 using CreateFromLocalFrameRefCallback = WebLocalFrameBase* (*)(LocalFrame&); |
| 36 |
| 37 CORE_EXPORT static void RegisterCreateFromLocalFramePtrCallback( |
| 38 CreateFromLocalFramePtrCallback); |
| 39 CORE_EXPORT static void RegisterCreateFromLocalFrameRefCallback( |
| 40 CreateFromLocalFrameRefCallback); |
| 41 |
| 42 virtual WebFrameClient* Client() const = 0; |
| 43 |
21 protected: | 44 protected: |
22 explicit WebLocalFrameBase(WebTreeScopeType scope) : WebLocalFrame(scope) {} | 45 explicit WebLocalFrameBase(WebTreeScopeType scope) : WebLocalFrame(scope) {} |
| 46 |
| 47 private: |
| 48 static CreateFromLocalFramePtrCallback create_local_frame_ptr_callback_; |
| 49 static CreateFromLocalFrameRefCallback create_local_frame_ref_callback_; |
23 }; | 50 }; |
24 } | 51 |
| 52 } // namespace blink |
25 | 53 |
26 #endif // WebLocalFrameBase_h | 54 #endif // WebLocalFrameBase_h |
OLD | NEW |