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

Unified Diff: xfa/fwl/lightwidget/cfwl_widget.h

Issue 2209153002: Use virtual function to retrieve interface pointer (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_pushbutton.cpp ('k') | xfa/fwl/lightwidget/cfwl_widget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/lightwidget/cfwl_widget.h
diff --git a/xfa/fwl/lightwidget/cfwl_widget.h b/xfa/fwl/lightwidget/cfwl_widget.h
index 2c180bad8ffef9653f6f1cb78e14d097357805b5..80e278e161064787102859f29d1d87d5a4ef3170 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.h
+++ b/xfa/fwl/lightwidget/cfwl_widget.h
@@ -7,6 +7,8 @@
#ifndef XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_
#define XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_
+#include <memory>
+
#include "xfa/fwl/core/cfwl_event.h"
#include "xfa/fwl/lightwidget/cfwl_widgetproperties.h"
#include "xfa/fwl/core/ifwl_widget.h"
@@ -21,7 +23,9 @@ class CFWL_Widget {
public:
virtual ~CFWL_Widget();
- IFWL_Widget* GetWidget();
+ virtual IFWL_Widget* GetWidget();
+ virtual const IFWL_Widget* GetWidget() const;
+
FWL_Error GetClassName(CFX_WideString& wsClass) const;
FWL_Type GetClassID() const;
virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const;
@@ -70,13 +74,14 @@ class CFWL_Widget {
CFX_SizeF CalcTextSize(const CFX_WideString& wsText,
FX_BOOL bMultiLine = FALSE,
int32_t iLineWidth = -1);
- IFWL_Widget* m_pIface;
- IFWL_WidgetDelegate* m_pDelegate;
- CFWL_WidgetMgr* m_pWidgetMgr;
- CFWL_WidgetProperties* m_pProperties;
protected:
FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
+
+ std::unique_ptr<IFWL_Widget> m_pIface;
+ IFWL_WidgetDelegate* m_pDelegate;
+ CFWL_WidgetMgr* const m_pWidgetMgr;
+ std::unique_ptr<CFWL_WidgetProperties> m_pProperties;
};
#endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_pushbutton.cpp ('k') | xfa/fwl/lightwidget/cfwl_widget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698