Commit 7ed7faa5 authored by Azeem Arshad's avatar Azeem Arshad Committed by Chromium LUCI CQ

[qr_code_generator] Move to //components

This CL moves qr_code_generator code from //chrome/common
to //components/qr_code_generator. This move will allow the
QRCodeGenerator class to be used in
chromeos/services/cellular_setup/esim_manager service where
a direct dependency to //chrome/common creates indirect DEPS
violations.

Bug: 1093185
Change-Id: I923d1613c46c2e1b194cb4eb3378db7aa5d51220
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595199Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Reviewed-by: default avatarTravis Skare <skare@chromium.org>
Commit-Queue: Azeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840886}
parent e0f9a223
...@@ -4206,7 +4206,6 @@ static_library("ui") { ...@@ -4206,7 +4206,6 @@ static_library("ui") {
"//base", "//base",
"//base/util/timer", "//base/util/timer",
"//chrome/browser/ui/views", "//chrome/browser/ui/views",
"//chrome/common/qr_code_generator",
"//components/constrained_window", "//components/constrained_window",
"//components/content_settings/browser/ui", "//components/content_settings/browser/ui",
"//components/media_message_center", "//components/media_message_center",
...@@ -4214,6 +4213,7 @@ static_library("ui") { ...@@ -4214,6 +4213,7 @@ static_library("ui") {
"//components/payments/content", "//components/payments/content",
"//components/payments/content:utils", "//components/payments/content:utils",
"//components/payments/core", "//components/payments/core",
"//components/qr_code_generator",
"//components/reading_list/features:flags", "//components/reading_list/features:flags",
"//components/tab_count_metrics", "//components/tab_count_metrics",
"//components/ui_devtools/views", "//components/ui_devtools/views",
......
...@@ -8,6 +8,7 @@ include_rules = [ ...@@ -8,6 +8,7 @@ include_rules = [
"+components/enterprise", "+components/enterprise",
"+components/infobars/android", "+components/infobars/android",
"+components/page_load_metrics/browser", "+components/page_load_metrics/browser",
"+components/qr_code_generator",
"+components/safety_check", "+components/safety_check",
"+components/translate/content/android", "+components/translate/content/android",
"+services/content/public", "+services/content/public",
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "base/base64url.h" #include "base/base64url.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "chrome/common/qr_code_generator/dino_image.h" #include "components/qr_code_generator/dino_image.h"
#include "chrome/common/qr_code_generator/qr_code_generator.h" #include "components/qr_code_generator/qr_code_generator.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/view.h" #include "ui/views/view.h"
......
...@@ -165,7 +165,6 @@ static_library("common") { ...@@ -165,7 +165,6 @@ static_library("common") {
"//chrome/common/net", "//chrome/common/net",
"//chrome/common/privacy_budget", "//chrome/common/privacy_budget",
"//chrome/common/profiler", "//chrome/common/profiler",
"//chrome/common/qr_code_generator",
"//chrome/common/search:mojo_bindings", "//chrome/common/search:mojo_bindings",
"//chrome/installer/util:with_no_strings", "//chrome/installer/util:with_no_strings",
"//components/cast_certificate", "//components/cast_certificate",
......
...@@ -13,7 +13,7 @@ source_set("qrcode_generator") { ...@@ -13,7 +13,7 @@ source_set("qrcode_generator") {
deps = [ deps = [
"//base", "//base",
"//chrome:strings", "//chrome:strings",
"//chrome/common/qr_code_generator", "//components/qr_code_generator",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//net", "//net",
"//ui/gfx", "//ui/gfx",
......
include_rules = [ include_rules = [
"+chrome/common/qr_code_generator.h", "+components/qr_code_generator",
] ]
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include <utility> #include <utility>
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/common/qr_code_generator/dino_image.h" #include "components/qr_code_generator/dino_image.h"
#include "chrome/common/qr_code_generator/qr_code_generator.h" #include "components/qr_code_generator/qr_code_generator.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
......
...@@ -3846,7 +3846,6 @@ test("unit_tests") { ...@@ -3846,7 +3846,6 @@ test("unit_tests") {
"../common/ini_parser_unittest.cc", "../common/ini_parser_unittest.cc",
"../common/net/safe_search_util_unittest.cc", "../common/net/safe_search_util_unittest.cc",
"../common/pref_names_util_unittest.cc", "../common/pref_names_util_unittest.cc",
"../common/qr_code_generator/qr_code_generator_unittest.cc",
"../renderer/chrome_content_renderer_client_unittest.cc", "../renderer/chrome_content_renderer_client_unittest.cc",
"../renderer/chrome_render_frame_observer_unittest.cc", "../renderer/chrome_render_frame_observer_unittest.cc",
"../renderer/instant_restricted_id_cache_unittest.cc", "../renderer/instant_restricted_id_cache_unittest.cc",
......
...@@ -127,6 +127,7 @@ test("components_unittests") { ...@@ -127,6 +127,7 @@ test("components_unittests") {
"//components/prefs:unit_tests", "//components/prefs:unit_tests",
"//components/previews/core:unit_tests", "//components/previews/core:unit_tests",
"//components/proxy_config:unit_tests", "//components/proxy_config:unit_tests",
"//components/qr_code_generator:unit_tests",
"//components/query_parser:unit_tests", "//components/query_parser:unit_tests",
"//components/rappor:unit_tests", "//components/rappor:unit_tests",
"//components/reading_list/core:unit_tests", "//components/reading_list/core:unit_tests",
......
...@@ -19,6 +19,16 @@ source_set("qr_code_generator") { ...@@ -19,6 +19,16 @@ source_set("qr_code_generator") {
public_deps = [ "//base" ] public_deps = [ "//base" ]
} }
source_set("unit_tests") {
testonly = true
sources = [ "qr_code_generator_unittest.cc" ]
deps = [
":qr_code_generator",
"//base",
"//testing/gtest",
]
}
if (enable_qr_print) { if (enable_qr_print) {
executable("qr_print") { executable("qr_print") {
sources = [ "qr_print.cc" ] sources = [ "qr_print.cc" ]
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_ #ifndef COMPONENTS_QR_CODE_GENERATOR_DINO_IMAGE_H_
#define CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_ #define COMPONENTS_QR_CODE_GENERATOR_DINO_IMAGE_H_
// Contains constants clients use to to render a dino on top of a QR image. // Contains constants clients use to to render a dino on top of a QR image.
namespace dino_image { namespace dino_image {
...@@ -68,4 +68,4 @@ static const unsigned char kDinoBody[kDinoWidthBytes * kDinoBodyHeight] = { ...@@ -68,4 +68,4 @@ static const unsigned char kDinoBody[kDinoWidthBytes * kDinoBodyHeight] = {
}; };
} // namespace dino_image } // namespace dino_image
#endif // CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_ #endif // COMPONENTS_QR_CODE_GENERATOR_DINO_IMAGE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/common/qr_code_generator/qr_code_generator.h" #include "components/qr_code_generator/qr_code_generator.h"
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_COMMON_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_ #ifndef COMPONENTS_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#define CHROME_COMMON_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_ #define COMPONENTS_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -141,4 +141,4 @@ class QRCodeGenerator { ...@@ -141,4 +141,4 @@ class QRCodeGenerator {
uint8_t clip_dump_; uint8_t clip_dump_;
}; };
#endif // CHROME_COMMON_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_ #endif // COMPONENTS_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/common/qr_code_generator/qr_code_generator.h" #include "components/qr_code_generator/qr_code_generator.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "base/containers/span.h" #include "base/containers/span.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "chrome/common/qr_code_generator/qr_code_generator.h" #include "components/qr_code_generator/qr_code_generator.h"
// kTerminalBackgroundIsBright controls the output polarity. Many QR scanners // kTerminalBackgroundIsBright controls the output polarity. Many QR scanners
// will cope with inverted bright / dark but, if you have a bright terminal // will cope with inverted bright / dark but, if you have a bright terminal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment