Commit 5b7da472 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Chromium LUCI CQ

Create components/permissions/vector_icons.

This patch creates a vector_icons target for components/permissions so
that we can move there any icons not used anywhere else. The two
existing icons for which this is true are accessibility.icon and
usb_security_key.icon.

Bug: 1110905
Change-Id: I13f6d2c9c54aabcae8beeb5d14ee40263c8ff62d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637598
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarIllia Klimov <elklm@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845632}
parent 7b42cd60
...@@ -75,6 +75,7 @@ source_set("permissions") { ...@@ -75,6 +75,7 @@ source_set("permissions") {
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
"//components/keyed_service/content", "//components/keyed_service/content",
"//components/permissions/prediction_service", "//components/permissions/prediction_service",
"//components/permissions/vector_icons",
"//components/strings:components_strings_grit", "//components/strings:components_strings_grit",
"//components/ukm/content", "//components/ukm/content",
"//components/url_formatter", "//components/url_formatter",
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "components/resources/android/theme_resources.h" #include "components/resources/android/theme_resources.h"
#else #else
#include "components/permissions/vector_icons/vector_icons.h"
#include "components/vector_icons/vector_icons.h" #include "components/vector_icons/vector_icons.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/vector_icon_types.h" #include "ui/gfx/vector_icon_types.h"
...@@ -63,7 +64,7 @@ int GetIconIdAndroid(RequestType type) { ...@@ -63,7 +64,7 @@ int GetIconIdAndroid(RequestType type) {
const gfx::VectorIcon& GetIconIdDesktop(RequestType type) { const gfx::VectorIcon& GetIconIdDesktop(RequestType type) {
switch (type) { switch (type) {
case RequestType::kAccessibilityEvents: case RequestType::kAccessibilityEvents:
return vector_icons::kAccessibilityIcon; return kAccessibilityIcon;
case RequestType::kArSession: case RequestType::kArSession:
case RequestType::kVrSession: case RequestType::kVrSession:
return vector_icons::kVrHeadsetIcon; return vector_icons::kVrHeadsetIcon;
...@@ -97,7 +98,7 @@ const gfx::VectorIcon& GetIconIdDesktop(RequestType type) { ...@@ -97,7 +98,7 @@ const gfx::VectorIcon& GetIconIdDesktop(RequestType type) {
case RequestType::kRegisterProtocolHandler: case RequestType::kRegisterProtocolHandler:
return vector_icons::kProtocolHandlerIcon; return vector_icons::kProtocolHandlerIcon;
case RequestType::kSecurityAttestation: case RequestType::kSecurityAttestation:
return vector_icons::kUsbSecurityKeyIcon; return kUsbSecurityKeyIcon;
case RequestType::kStorageAccess: case RequestType::kStorageAccess:
return vector_icons::kCookieIcon; return vector_icons::kCookieIcon;
case RequestType::kWindowPlacement: case RequestType::kWindowPlacement:
......
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//components/vector_icons/vector_icons.gni")
aggregate_vector_icons("permissions_vector_icons") {
icon_directory = "."
sources = [
"accessibility.icon",
"usb_security_key.icon",
]
}
source_set("vector_icons") {
sources = get_target_outputs(":permissions_vector_icons")
deps = [
":permissions_vector_icons",
"//base",
"//skia",
"//ui/gfx",
]
}
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// vector_icons.cc.template is used to generate vector_icons.cc. Edit the former
// rather than the latter.
#include "components/permissions/vector_icons/vector_icons.h"
#include "components/vector_icons/cc_macros.h"
#include "ui/gfx/animation/tween.h"
#include "ui/gfx/vector_icon_types.h"
#define DECLARE_VECTOR_COMMAND(x) using gfx::x;
DECLARE_VECTOR_COMMANDS
namespace permissions {
TEMPLATE_PLACEHOLDER
} // namespace permissions
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// vector_icons.h.template is used to generate vector_icons.h. Edit the former
// rather than the latter.
#ifndef COMPONENTS_PERMISSIONS_VECTOR_ICONS_VECTOR_ICONS_H_
#define COMPONENTS_PERMISSIONS_VECTOR_ICONS_VECTOR_ICONS_H_
namespace gfx {
struct VectorIcon;
}
#define VECTOR_ICON_TEMPLATE_H(icon_name) \
extern const gfx::VectorIcon icon_name;
namespace permissions {
TEMPLATE_PLACEHOLDER
} // namespace permissions
#undef VECTOR_ICON_TEMPLATE_H
#endif // COMPONENTS_PERMISSIONS_VECTOR_ICONS_VECTOR_ICONS_H_
...@@ -8,7 +8,6 @@ aggregate_vector_icons("components_vector_icons") { ...@@ -8,7 +8,6 @@ aggregate_vector_icons("components_vector_icons") {
icon_directory = "." icon_directory = "."
sources = [ sources = [
"accessibility.icon",
"add_cellular_network.icon", "add_cellular_network.icon",
"ads.icon", "ads.icon",
"back_arrow.icon", "back_arrow.icon",
...@@ -83,7 +82,6 @@ aggregate_vector_icons("components_vector_icons") { ...@@ -83,7 +82,6 @@ aggregate_vector_icons("components_vector_icons") {
"settings.icon", "settings.icon",
"sync.icon", "sync.icon",
"usb.icon", "usb.icon",
"usb_security_key.icon",
"videocam.icon", "videocam.icon",
"videocam_off.icon", "videocam_off.icon",
"videogame_asset.icon", "videogame_asset.icon",
......
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