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") {
"//base",
"//base/util/timer",
"//chrome/browser/ui/views",
"//chrome/common/qr_code_generator",
"//components/constrained_window",
"//components/content_settings/browser/ui",
"//components/media_message_center",
......@@ -4214,6 +4213,7 @@ static_library("ui") {
"//components/payments/content",
"//components/payments/content:utils",
"//components/payments/core",
"//components/qr_code_generator",
"//components/reading_list/features:flags",
"//components/tab_count_metrics",
"//components/ui_devtools/views",
......
......@@ -8,6 +8,7 @@ include_rules = [
"+components/enterprise",
"+components/infobars/android",
"+components/page_load_metrics/browser",
"+components/qr_code_generator",
"+components/safety_check",
"+components/translate/content/android",
"+services/content/public",
......
......@@ -7,8 +7,8 @@
#include "base/base64url.h"
#include "base/rand_util.h"
#include "base/strings/string_piece.h"
#include "chrome/common/qr_code_generator/dino_image.h"
#include "chrome/common/qr_code_generator/qr_code_generator.h"
#include "components/qr_code_generator/dino_image.h"
#include "components/qr_code_generator/qr_code_generator.h"
#include "ui/gfx/canvas.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/view.h"
......
......@@ -165,7 +165,6 @@ static_library("common") {
"//chrome/common/net",
"//chrome/common/privacy_budget",
"//chrome/common/profiler",
"//chrome/common/qr_code_generator",
"//chrome/common/search:mojo_bindings",
"//chrome/installer/util:with_no_strings",
"//components/cast_certificate",
......
......@@ -13,7 +13,7 @@ source_set("qrcode_generator") {
deps = [
"//base",
"//chrome:strings",
"//chrome/common/qr_code_generator",
"//components/qr_code_generator",
"//mojo/public/cpp/bindings",
"//net",
"//ui/gfx",
......
include_rules = [
"+chrome/common/qr_code_generator.h",
"+components/qr_code_generator",
]
......@@ -9,8 +9,8 @@
#include <utility>
#include "base/strings/string_util.h"
#include "chrome/common/qr_code_generator/dino_image.h"
#include "chrome/common/qr_code_generator/qr_code_generator.h"
#include "components/qr_code_generator/dino_image.h"
#include "components/qr_code_generator/qr_code_generator.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/size.h"
......
......@@ -3846,7 +3846,6 @@ test("unit_tests") {
"../common/ini_parser_unittest.cc",
"../common/net/safe_search_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_render_frame_observer_unittest.cc",
"../renderer/instant_restricted_id_cache_unittest.cc",
......
......@@ -127,6 +127,7 @@ test("components_unittests") {
"//components/prefs:unit_tests",
"//components/previews/core:unit_tests",
"//components/proxy_config:unit_tests",
"//components/qr_code_generator:unit_tests",
"//components/query_parser:unit_tests",
"//components/rappor:unit_tests",
"//components/reading_list/core:unit_tests",
......
......@@ -19,6 +19,16 @@ source_set("qr_code_generator") {
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) {
executable("qr_print") {
sources = [ "qr_print.cc" ]
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_
#define CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_
#ifndef COMPONENTS_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.
namespace dino_image {
......@@ -68,4 +68,4 @@ static const unsigned char kDinoBody[kDinoWidthBytes * kDinoBodyHeight] = {
};
} // namespace dino_image
#endif // CHROME_COMMON_QR_CODE_GENERATOR_DINO_IMAGE_H_
#endif // COMPONENTS_QR_CODE_GENERATOR_DINO_IMAGE_H_
......@@ -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 "chrome/common/qr_code_generator/qr_code_generator.h"
#include "components/qr_code_generator/qr_code_generator.h"
#include <math.h>
#include <string.h>
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#define CHROME_COMMON_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#ifndef COMPONENTS_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#define COMPONENTS_QR_CODE_GENERATOR_QR_CODE_GENERATOR_H_
#include <stddef.h>
#include <stdint.h>
......@@ -141,4 +141,4 @@ class QRCodeGenerator {
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 @@
// Use of this source code is governed by a BSD-style license that can be
// 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"
......
......@@ -14,7 +14,7 @@
#include "base/containers/span.h"
#include "base/optional.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
// 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