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. | |
dcheng
2017/05/05 06:29:58
I'm really tempted to say that we should just #inc
slangley
2017/05/05 09:25:08
There are scenarios that don't link in libblink_we
haraken
2017/05/05 13:48:51
Yeah, I want to avoid using the callback pattern.
slangley
2017/05/07 00:12:10
We don't have a way to get a reference to a Chrome
haraken
2017/05/08 00:01:58
When you call WebLocalFrameImpl::FromFrame(Frame*)
slangley
2017/05/08 01:47:49
Seems true - i wasn't able to grok that many indir
| |
34 using CreateFromLocalFramePtrCallback = WebLocalFrameBase* (*)(LocalFrame*); | |
35 | |
36 CORE_EXPORT static void RegisterCreateFromLocalFramePtrCallback( | |
37 CreateFromLocalFramePtrCallback); | |
38 | |
39 virtual WebFrameClient* Client() const = 0; | |
40 | |
21 protected: | 41 protected: |
22 explicit WebLocalFrameBase(WebTreeScopeType scope) : WebLocalFrame(scope) {} | 42 explicit WebLocalFrameBase(WebTreeScopeType scope) : WebLocalFrame(scope) {} |
43 | |
44 private: | |
45 static CreateFromLocalFramePtrCallback create_local_frame_ptr_callback_; | |
23 }; | 46 }; |
24 } | 47 |
48 } // namespace blink | |
25 | 49 |
26 #endif // WebLocalFrameBase_h | 50 #endif // WebLocalFrameBase_h |
OLD | NEW |