Remove FWL Create methods, use new instead

Review-Url: https://chromiumcodereview.appspot.com/2422303003
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.cpp b/xfa/fwl/lightwidget/cfwl_barcode.cpp
index 24dce17..dd8d9f0 100644
--- a/xfa/fwl/lightwidget/cfwl_barcode.cpp
+++ b/xfa/fwl/lightwidget/cfwl_barcode.cpp
@@ -16,10 +16,6 @@
   return static_cast<IFWL_Barcode*>(m_pIface.get());
 }
 
-CFWL_Barcode* CFWL_Barcode::Create() {
-  return new CFWL_Barcode;
-}
-
 FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
     return FWL_Error::Indefinite;
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.h b/xfa/fwl/lightwidget/cfwl_barcode.h
index cf394f6..83a58c1 100644
--- a/xfa/fwl/lightwidget/cfwl_barcode.h
+++ b/xfa/fwl/lightwidget/cfwl_barcode.h
@@ -16,7 +16,8 @@
 
 class CFWL_Barcode : public CFWL_Edit {
  public:
-  static CFWL_Barcode* Create();
+  CFWL_Barcode();
+  ~CFWL_Barcode() override;
 
   IFWL_Barcode* GetWidget() override;
   const IFWL_Barcode* GetWidget() const override;
@@ -83,9 +84,6 @@
   }
 
  protected:
-  CFWL_Barcode();
-  ~CFWL_Barcode() override;
-
   class CFWL_BarcodeDP : public IFWL_BarcodeDP {
    public:
     CFWL_BarcodeDP();
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.cpp b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
index 1f59ee1..d14ed51 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
@@ -18,10 +18,6 @@
   return static_cast<IFWL_CheckBox*>(m_pIface.get());
 }
 
-CFWL_CheckBox* CFWL_CheckBox::Create() {
-  return new CFWL_CheckBox;
-}
-
 FWL_Error CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
     return FWL_Error::Indefinite;
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.h b/xfa/fwl/lightwidget/cfwl_checkbox.h
index 51e6294..ef66280 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.h
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.h
@@ -18,8 +18,6 @@
   IFWL_CheckBox* GetWidget() override;
   const IFWL_CheckBox* GetWidget() const override;
 
-  static CFWL_CheckBox* Create();
-
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
   FWL_Error SetBoxSize(FX_FLOAT fHeight);
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.cpp b/xfa/fwl/lightwidget/cfwl_combobox.cpp
index 678edc4..4ec323a 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_combobox.cpp
@@ -19,10 +19,6 @@
   return static_cast<IFWL_ComboBox*>(m_pIface.get());
 }
 
-CFWL_ComboBox* CFWL_ComboBox::Create() {
-  return new CFWL_ComboBox;
-}
-
 FWL_Error CFWL_ComboBox::Initialize(const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
     return FWL_Error::Indefinite;
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.h b/xfa/fwl/lightwidget/cfwl_combobox.h
index 186d4b7..bbcec3b 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.h
+++ b/xfa/fwl/lightwidget/cfwl_combobox.h
@@ -26,7 +26,6 @@
   IFWL_ComboBox* GetWidget() override;
   const IFWL_ComboBox* GetWidget() const override;
 
-  static CFWL_ComboBox* Create();
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   int32_t AddString(const CFX_WideStringC& wsText);
   int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon);
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
index 1256e1a..828f9cf 100644
--- a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
@@ -20,10 +20,6 @@
   return static_cast<IFWL_DateTimePicker*>(m_pIface.get());
 }
 
-CFWL_DateTimePicker* CFWL_DateTimePicker::Create() {
-  return new CFWL_DateTimePicker;
-}
-
 FWL_Error CFWL_DateTimePicker::Initialize(
     const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.h b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
index d727729..e73919c 100644
--- a/xfa/fwl/lightwidget/cfwl_datetimepicker.h
+++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
@@ -12,7 +12,8 @@
 
 class CFWL_DateTimePicker : public CFWL_Widget {
  public:
-  static CFWL_DateTimePicker* Create();
+  CFWL_DateTimePicker();
+  ~CFWL_DateTimePicker() override;
 
   IFWL_DateTimePicker* GetWidget() override;
   const IFWL_DateTimePicker* GetWidget() const override;
@@ -63,9 +64,6 @@
     CFX_WideString m_wsData;
   };
 
-  CFWL_DateTimePicker();
-  ~CFWL_DateTimePicker() override;
-
   CFWL_DateTimePickerDP m_DateTimePickerDP;
 };
 
diff --git a/xfa/fwl/lightwidget/cfwl_edit.cpp b/xfa/fwl/lightwidget/cfwl_edit.cpp
index b74cd05..5637040 100644
--- a/xfa/fwl/lightwidget/cfwl_edit.cpp
+++ b/xfa/fwl/lightwidget/cfwl_edit.cpp
@@ -17,10 +17,6 @@
   return static_cast<IFWL_Edit*>(m_pIface.get());
 }
 
-CFWL_Edit* CFWL_Edit::Create() {
-  return new CFWL_Edit;
-}
-
 FWL_Error CFWL_Edit::Initialize(const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
     return FWL_Error::Indefinite;
diff --git a/xfa/fwl/lightwidget/cfwl_edit.h b/xfa/fwl/lightwidget/cfwl_edit.h
index a9a466a..6c70c43 100644
--- a/xfa/fwl/lightwidget/cfwl_edit.h
+++ b/xfa/fwl/lightwidget/cfwl_edit.h
@@ -23,7 +23,6 @@
   IFWL_Edit* GetWidget() override;
   const IFWL_Edit* GetWidget() const override;
 
-  static CFWL_Edit* Create();
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   FWL_Error SetText(const CFX_WideString& wsText);
   int32_t GetTextLength() const;
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp
index d5ea879..eb984d6 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp
@@ -18,10 +18,6 @@
   return static_cast<IFWL_ListBox*>(m_pIface.get());
 }
 
-CFWL_ListBox* CFWL_ListBox::Create() {
-  return new CFWL_ListBox;
-}
-
 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
     return FWL_Error::Indefinite;
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h
index f647ae8..a3bba8b 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.h
+++ b/xfa/fwl/lightwidget/cfwl_listbox.h
@@ -25,7 +25,6 @@
   IFWL_ListBox* GetWidget() override;
   const IFWL_ListBox* GetWidget() const override;
 
-  static CFWL_ListBox* Create();
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem);
   IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd,
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.cpp b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
index 8e0cc60..e6328e7 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
@@ -16,10 +16,6 @@
   return static_cast<IFWL_PictureBox*>(m_pIface.get());
 }
 
-CFWL_PictureBox* CFWL_PictureBox::Create() {
-  return new CFWL_PictureBox;
-}
-
 FWL_Error CFWL_PictureBox::Initialize(
     const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.h b/xfa/fwl/lightwidget/cfwl_picturebox.h
index 612ff1d..c039892 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.h
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.h
@@ -19,8 +19,6 @@
   IFWL_PictureBox* GetWidget() override;
   const IFWL_PictureBox* GetWidget() const override;
 
-  static CFWL_PictureBox* Create();
-
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   CFX_DIBitmap* GetPicture();
   FWL_Error SetPicture(CFX_DIBitmap* pBitmap);
diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
index b103169..79afe80 100644
--- a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
+++ b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
@@ -16,10 +16,6 @@
   return static_cast<IFWL_PushButton*>(m_pIface.get());
 }
 
-CFWL_PushButton* CFWL_PushButton::Create() {
-  return new CFWL_PushButton;
-}
-
 FWL_Error CFWL_PushButton::Initialize(
     const CFWL_WidgetProperties* pProperties) {
   if (m_pIface)
diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.h b/xfa/fwl/lightwidget/cfwl_pushbutton.h
index ce26a54..13629fa 100644
--- a/xfa/fwl/lightwidget/cfwl_pushbutton.h
+++ b/xfa/fwl/lightwidget/cfwl_pushbutton.h
@@ -18,8 +18,6 @@
   IFWL_PushButton* GetWidget() override;
   const IFWL_PushButton* GetWidget() const override;
 
-  static CFWL_PushButton* Create();
-
   FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
   FWL_Error GetCaption(CFX_WideString& wsCaption);
   FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp
index 4bb3ba0..42564e9 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.cpp
+++ b/xfa/fxfa/app/xfa_ffbarcode.cpp
@@ -121,10 +121,9 @@
     : CXFA_FFTextEdit(pPageView, pDataAcc) {}
 CXFA_FFBarcode::~CXFA_FFBarcode() {}
 FX_BOOL CXFA_FFBarcode::LoadWidget() {
-  CFWL_Barcode* pFWLBarcode = CFWL_Barcode::Create();
-  if (pFWLBarcode) {
-    pFWLBarcode->Initialize();
-  }
+  CFWL_Barcode* pFWLBarcode = new CFWL_Barcode;
+  pFWLBarcode->Initialize();
+
   m_pNormalWidget = pFWLBarcode;
   m_pNormalWidget->SetLayoutItem(this);
   IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 15ff960..726abf7 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -25,7 +25,7 @@
 }
 CXFA_FFCheckButton::~CXFA_FFCheckButton() {}
 FX_BOOL CXFA_FFCheckButton::LoadWidget() {
-  CFWL_CheckBox* pCheckBox = CFWL_CheckBox::Create();
+  CFWL_CheckBox* pCheckBox = new CFWL_CheckBox;
   pCheckBox->Initialize();
   m_pNormalWidget = pCheckBox;
   m_pNormalWidget->SetLayoutItem(this);
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 641b163..00c8348 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -30,7 +30,7 @@
   }
 }
 FX_BOOL CXFA_FFListBox::LoadWidget() {
-  CFWL_ListBox* pListBox = CFWL_ListBox::Create();
+  CFWL_ListBox* pListBox = new CFWL_ListBox;
   pListBox->Initialize();
   pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground,
                          0xFFFFFFFF);
@@ -227,7 +227,7 @@
   return FALSE;
 }
 FX_BOOL CXFA_FFComboBox::LoadWidget() {
-  CFWL_ComboBox* pComboBox = CFWL_ComboBox::Create();
+  CFWL_ComboBox* pComboBox = new CFWL_ComboBox;
   pComboBox->Initialize();
   m_pNormalWidget = (CFWL_Widget*)pComboBox;
   m_pNormalWidget->SetLayoutItem(this);
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index cd395b4..77341cd 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -52,10 +52,9 @@
 }
 FX_BOOL CXFA_FFPushButton::LoadWidget() {
   ASSERT(!m_pNormalWidget);
-  CFWL_PushButton* pPushButton = CFWL_PushButton::Create();
-  if (pPushButton) {
-    pPushButton->Initialize();
-  }
+  CFWL_PushButton* pPushButton = new CFWL_PushButton;
+  pPushButton->Initialize();
+
   m_pOldDelegate = pPushButton->SetDelegate(this);
   m_pNormalWidget = pPushButton;
   m_pNormalWidget->SetLayoutItem(this);
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 9d0f35e..bd5b22f 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -35,7 +35,7 @@
   }
 }
 FX_BOOL CXFA_FFTextEdit::LoadWidget() {
-  CFWL_Edit* pFWLEdit = CFWL_Edit::Create();
+  CFWL_Edit* pFWLEdit = new CFWL_Edit;
   pFWLEdit->Initialize();
   m_pNormalWidget = pFWLEdit;
   m_pNormalWidget->SetLayoutItem(this);
@@ -436,7 +436,7 @@
     : CXFA_FFTextEdit(pPageView, pDataAcc) {}
 CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {}
 FX_BOOL CXFA_FFNumericEdit::LoadWidget() {
-  CFWL_Edit* pWidget = CFWL_Edit::Create();
+  CFWL_Edit* pWidget = new CFWL_Edit;
   pWidget->Initialize();
   m_pNormalWidget = pWidget;
   IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget();
@@ -510,7 +510,7 @@
     : CXFA_FFTextEdit(pPageView, pDataAcc) {}
 CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {}
 FX_BOOL CXFA_FFPasswordEdit::LoadWidget() {
-  CFWL_Edit* pWidget = CFWL_Edit::Create();
+  CFWL_Edit* pWidget = new CFWL_Edit;
   pWidget->Initialize();
   m_pNormalWidget = pWidget;
   m_pNormalWidget->SetLayoutItem(this);
@@ -576,7 +576,7 @@
   return FALSE;
 }
 FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() {
-  CFWL_DateTimePicker* pWidget = CFWL_DateTimePicker::Create();
+  CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker;
   pWidget->Initialize();
   m_pNormalWidget = pWidget;
   m_pNormalWidget->SetLayoutItem(this);