Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: third_party/WebKit/Source/core/exported/WebPluginContainerBase.h

Issue 2886113002: Introduce WebPluginContainerBase to abstract WebPluginContainerImpl. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.#ifndef WebViewBase_h
4
5 #ifndef WebPluginContainerBase_h
6 #define WebPluginContainerBase_h
7
8 #include "core/CoreExport.h"
9 #include "core/dom/ContextLifecycleObserver.h"
10 #include "core/plugins/PluginView.h"
11 #include "public/web/WebPluginContainer.h"
12
13 namespace blink {
14
15 class ResourceError;
16
17 struct WebPrintParams;
18 struct WebPrintPresetOptions;
19
20 // WebPluginContainerBase is a temporary class the provides a layer of
21 // abstraction for WebPluginContainerImpl. Mehtods that are declared public in
22 // WebPluginContainerImpl that are not overrides from PluginView,
23 // WebPuglinContainer or ContextClient will be declared pure virtual in
24 // WebPluginContainerBase. Classes that then have a dependency on
25 // WebPluginContainerImpl will then take a dependency on WebPluginContainerBase
26 // instead, so we can remove cyclic dependencies in web/ and move classes from
27 // web/ into core/ or modules.
28 // TODO(slangley): Remove this class once WebPluginContainerImpl is in core/.
29 class CORE_EXPORT WebPluginContainerBase
30 : public GarbageCollectedFinalized<WebPluginContainerBase>,
31 public PluginView,
32 NON_EXPORTED_BASE(public WebPluginContainer),
33 public ContextClient {
34 USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerBase);
35 USING_PRE_FINALIZER(WebPluginContainerBase, DispatchDispose);
36
37 public:
38 virtual int PrintBegin(const WebPrintParams&) const = 0;
39 virtual void PrintPage(int page_number, GraphicsContext&, const IntRect&) = 0;
40 virtual void PrintEnd() = 0;
41 virtual bool ExecuteEditCommand(const WebString& name) = 0;
42 virtual bool ExecuteEditCommand(const WebString& name,
43 const WebString& value) = 0;
44 virtual bool SupportsPaginatedPrint() const = 0;
45 virtual bool IsPrintScalingDisabled() const = 0;
46 virtual bool GetPrintPresetOptionsFromDocument(
47 WebPrintPresetOptions*) const = 0;
48 virtual void DidFinishLoading() = 0;
49 virtual void DidFailLoading(const ResourceError&) = 0;
50 virtual void CalculateGeometry(IntRect& window_rect,
51 IntRect& clip_rect,
52 IntRect& unobscured_rect) = 0;
53
54 DECLARE_VIRTUAL_TRACE();
55 // USING_PRE_FINALIZER does not allow for virtual dispatch from the finalizer
56 // method. Here we call Dispose() which does the correct virtual dispatch.
57 void DispatchDispose() { Dispose(); }
haraken 2017/05/19 07:44:15 This is confusing. Can we do something like: - Mo
58
59 protected:
60 explicit WebPluginContainerBase(LocalFrame*);
61 };
62
63 DEFINE_TYPE_CASTS(WebPluginContainerBase,
64 PluginView,
65 plugin,
66 plugin->IsPluginContainer(),
67 plugin.IsPluginContainer());
68 // Unlike FrameViewBase, we need not worry about object type for container.
69 // WebPluginContainerBase is the only subclass of WebPluginContainer.
70 DEFINE_TYPE_CASTS(WebPluginContainerBase,
71 WebPluginContainer,
72 container,
73 true,
74 true);
75
76 } // nammespace blink
77
78 #endif // WebPluginContainerBase_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/exported/BUILD.gn ('k') | third_party/WebKit/Source/core/exported/WebPluginContainerBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698