Move CFX_Barcode from fwl/ to fxbarcode/

FWL is a windowing layer, but this code doesn't have much to do
with windowing. Instead, it is a top-level entry point for much
of the barcode library underneath it. All the other fwl/ files
are prefixed with cfwl_, so this was inconsistent.

Change-Id: Iafa583bd5d3f10753006232af3d7fcd9ae90a157
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/64652
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index f27a2f4..38739d1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -267,7 +267,6 @@
       "xfa/fde:unittests",
       "xfa/fgas:unittests",
       "xfa/fgas/layout:unittests",
-      "xfa/fwl:unittests",
       "xfa/fxfa:unittests",
       "xfa/fxfa/fm2js:unittests",
       "xfa/fxfa/parser:unittests",
diff --git a/fxbarcode/BUILD.gn b/fxbarcode/BUILD.gn
index 8c092ea..2b10e95 100644
--- a/fxbarcode/BUILD.gn
+++ b/fxbarcode/BUILD.gn
@@ -39,6 +39,8 @@
     "cbc_qrcode.h",
     "cbc_upca.cpp",
     "cbc_upca.h",
+    "cfx_barcode.cpp",
+    "cfx_barcode.h",
     "common/BC_CommonBitMatrix.cpp",
     "common/BC_CommonBitMatrix.h",
     "common/BC_CommonByteMatrix.cpp",
@@ -143,6 +145,7 @@
 pdfium_unittest_source_set("unittests") {
   sources = [
     "cbc_pdf417i_unittest.cpp",
+    "cfx_barcode_unittest.cpp",
     "datamatrix/BC_DataMatrixWriter_unittest.cpp",
     "oned/BC_OnedCodaBarWriter_unittest.cpp",
     "oned/BC_OnedCode128Writer_unittest.cpp",
@@ -156,6 +159,7 @@
   ]
   deps = [
     ":fxbarcode",
+    "../core/fxge",
   ]
   pdfium_root_dir = "../"
 }
diff --git a/xfa/fwl/cfx_barcode.cpp b/fxbarcode/cfx_barcode.cpp
similarity index 98%
rename from xfa/fwl/cfx_barcode.cpp
rename to fxbarcode/cfx_barcode.cpp
index 086632d..54addad 100644
--- a/xfa/fwl/cfx_barcode.cpp
+++ b/fxbarcode/cfx_barcode.cpp
@@ -4,7 +4,7 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/fwl/cfx_barcode.h"
+#include "fxbarcode/cfx_barcode.h"
 
 #include <memory>
 
diff --git a/xfa/fwl/cfx_barcode.h b/fxbarcode/cfx_barcode.h
similarity index 93%
rename from xfa/fwl/cfx_barcode.h
rename to fxbarcode/cfx_barcode.h
index d387671..14204ea 100644
--- a/xfa/fwl/cfx_barcode.h
+++ b/fxbarcode/cfx_barcode.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_FWL_CFX_BARCODE_H_
-#define XFA_FWL_CFX_BARCODE_H_
+#ifndef FXBARCODE_CFX_BARCODE_H_
+#define FXBARCODE_CFX_BARCODE_H_
 
 #include <memory>
 
@@ -59,4 +59,4 @@
   std::unique_ptr<CBC_CodeBase> m_pBCEngine;
 };
 
-#endif  // XFA_FWL_CFX_BARCODE_H_
+#endif  // FXBARCODE_CFX_BARCODE_H_
diff --git a/xfa/fwl/cfx_barcode_unittest.cpp b/fxbarcode/cfx_barcode_unittest.cpp
similarity index 98%
rename from xfa/fwl/cfx_barcode_unittest.cpp
rename to fxbarcode/cfx_barcode_unittest.cpp
index 54db94a..7569bf2 100644
--- a/xfa/fwl/cfx_barcode_unittest.cpp
+++ b/fxbarcode/cfx_barcode_unittest.cpp
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "xfa/fwl/cfx_barcode.h"
+#include "fxbarcode/cfx_barcode.h"
 
 #include <memory>
 #include <string>
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index cc72b46..df9c264 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -259,7 +259,7 @@
       ]
       deps = [
         "../../core/fxcrt",
-        "../../xfa/fwl",
+        "../../fxbarcode",
         "//third_party/icu:icuuc",
       ]
     }
diff --git a/testing/fuzzers/DEPS b/testing/fuzzers/DEPS
index b1d034e..fe9eaf6 100644
--- a/testing/fuzzers/DEPS
+++ b/testing/fuzzers/DEPS
@@ -1,3 +1,4 @@
 include_rules = [
+  '+fxbarcode',
   '+xfa',
 ]
diff --git a/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc b/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc
index f4d1d8b..7b31b2b 100644
--- a/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc
+++ b/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc
@@ -5,7 +5,7 @@
 #include <memory>
 
 #include "core/fxcrt/fx_string.h"
-#include "xfa/fwl/cfx_barcode.h"
+#include "fxbarcode/cfx_barcode.h"
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   if (size < 2 * sizeof(uint16_t))
diff --git a/xfa/fwl/BUILD.gn b/xfa/fwl/BUILD.gn
index 4ef9cc1..5d3d058 100644
--- a/xfa/fwl/BUILD.gn
+++ b/xfa/fwl/BUILD.gn
@@ -79,8 +79,6 @@
     "cfwl_widgetmgr.h",
     "cfwl_widgetproperties.cpp",
     "cfwl_widgetproperties.h",
-    "cfx_barcode.cpp",
-    "cfx_barcode.h",
     "fwl_widgetdef.h",
     "fwl_widgethit.h",
     "ifwl_themeprovider.h",
@@ -126,17 +124,6 @@
   visibility = [ "../../*" ]
 }
 
-pdfium_unittest_source_set("unittests") {
-  sources = [
-    "cfx_barcode_unittest.cpp",
-  ]
-  deps = [
-    ":fwl",
-    "../../core/fxge",
-  ]
-  pdfium_root_dir = "../../"
-}
-
 pdfium_embeddertest_source_set("embeddertests") {
   sources = [
     "cfwl_edit_embeddertest.cpp",
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp
index 592bf2a..008424d 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -8,11 +8,11 @@
 
 #include <utility>
 
+#include "fxbarcode/cfx_barcode.h"
 #include "third_party/base/ptr_util.h"
 #include "xfa/fgas/font/cfgas_gefont.h"
 #include "xfa/fwl/cfwl_notedriver.h"
 #include "xfa/fwl/cfwl_themepart.h"
-#include "xfa/fwl/cfx_barcode.h"
 #include "xfa/fwl/ifwl_themeprovider.h"
 #include "xfa/fwl/theme/cfwl_utils.h"