Commit 7191df2b authored by Christopher Lam's avatar Christopher Lam Committed by Commit Bot

[cros_colors] Move cros_colors from ui/resources/css to ui/chromeos/colors

This CL moves the centralized style sheet to ui/chromeos/colors since it's
being used for Views as well as WebUI.

A new chrome://resources alias was added so the file can be accessed
through chrome://resources/chromeos/colors/cros_colors.generated.css.

Bug: 1018654
Change-Id: If7fb5c0aed3fa30746df32587e818a4f420ba49c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2306140Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Commit-Queue: calamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792186}
parent 46f54a04
...@@ -1629,6 +1629,7 @@ component("ash") { ...@@ -1629,6 +1629,7 @@ component("ash") {
"//ui/base/ime/chromeos", "//ui/base/ime/chromeos",
"//ui/base/ime/init", "//ui/base/ime/init",
"//ui/chromeos", "//ui/chromeos",
"//ui/chromeos/colors:cros_colors_views",
"//ui/chromeos/events", "//ui/chromeos/events",
"//ui/chromeos/resources", "//ui/chromeos/resources",
"//ui/compositor", "//ui/compositor",
...@@ -1650,7 +1651,6 @@ component("ash") { ...@@ -1650,7 +1651,6 @@ component("ash") {
"//ui/platform_window/stub", "//ui/platform_window/stub",
"//ui/snapshot", "//ui/snapshot",
"//ui/views/window/vector_icons", "//ui/views/window/vector_icons",
"//ui/webui/resources/css:cros_colors_views",
"//ui/wm/public", "//ui/wm/public",
"//url", "//url",
] ]
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "ui/chromeos/colors/cros_colors.h"
#include "ui/gfx/color_analysis.h" #include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
...@@ -20,7 +21,6 @@ ...@@ -20,7 +21,6 @@
#include "ui/views/background.h" #include "ui/views/background.h"
#include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/label_button.h"
#include "ui/webui/resources/css/cros_colors.h"
namespace ash { namespace ash {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
} }
</style> </style>
<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<script type="module" src="app.js"></script> <script type="module" src="app.js"></script>
</head> </head>
<body> <body>
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
......
...@@ -36,7 +36,7 @@ if (optimize_webui) { ...@@ -36,7 +36,7 @@ if (optimize_webui) {
] ]
excludes = [ excludes = [
# TODO(calamity): Update optimize_webui to handle generated files. # TODO(calamity): Update optimize_webui to handle generated files.
"chrome://resources/css/cros_colors.generated.css", "chrome://resources/chromeos/colors/cros_colors.generated.css",
"chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom.html", "chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom.html",
"chrome://os-settings/app-management/app_management.mojom-lite.js", "chrome://os-settings/app-management/app_management.mojom-lite.js",
"chrome://os-settings/app-management/file_path.mojom-lite.js", "chrome://os-settings/app-management/file_path.mojom-lite.js",
...@@ -74,7 +74,7 @@ if (optimize_webui) { ...@@ -74,7 +74,7 @@ if (optimize_webui) {
"chrome://resources/mojo/services/network/public/mojom/ip_address.mojom-lite.js", "chrome://resources/mojo/services/network/public/mojom/ip_address.mojom-lite.js",
"chrome://resources/cr_components/chromeos/network/mojo_interface_provider.m.js", "chrome://resources/cr_components/chromeos/network/mojo_interface_provider.m.js",
"chrome://resources/js/cr.m.js", "chrome://resources/js/cr.m.js",
"chrome://resources/css/cros_colors.generated.css", "chrome://resources/chromeos/colors/cros_colors.generated.css",
"chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js", "chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js",
"chrome://resources/mojo/url/mojom/url.mojom-lite.js", "chrome://resources/mojo/url/mojom/url.mojom-lite.js",
"app-management/app_management.mojom-lite.js", "app-management/app_management.mojom-lite.js",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<if expr="not optimize_webui"> <if expr="not optimize_webui">
<base href="chrome://os-settings"> <base href="chrome://os-settings">
</if> </if>
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<style> <style>
html { html {
background-color: var(--cros-bg-color); background-color: var(--cros-bg-color);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>$i18n{settings}</title> <title>$i18n{settings}</title>
<base href="chrome://os-settings"> <base href="chrome://os-settings">
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<style> <style>
html { html {
background-color: var(--cros-bg-color); background-color: var(--cros-bg-color);
......
<link rel="stylesheet" <link rel="stylesheet"
href="chrome://resources/css/cros_colors.generated.css"> href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
<link rel="stylesheet" href="chrome://resources/css/md_colors.css"> <link rel="stylesheet" href="chrome://resources/css/md_colors.css">
<template> <template>
......
...@@ -70,6 +70,9 @@ const std::map<std::string, std::string> CreatePathPrefixAliasesMap() { ...@@ -70,6 +70,9 @@ const std::map<std::string, std::string> CreatePathPrefixAliasesMap() {
// more context: crbug.com/1020284. // more context: crbug.com/1020284.
{"@out_folder@/android_clang_arm/gen/ui/webui/resources/", ""}, {"@out_folder@/android_clang_arm/gen/ui/webui/resources/", ""},
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
{"@out_folder@/gen/ui/chromeos/", "chromeos/"},
#endif // defined(OS_CHROMEOS)
}; };
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
......
# Copyright 2020 The Chromium Authors. All rights reserved. # Copyright 2020 The Chromium Authors. All rights reserved.
# 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.
......
calamity@chromium.org
# COMPONENT: UI
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="stylesheet" href="chrome://resources/css/action_link.css"> <link rel="stylesheet" href="chrome://resources/css/action_link.css">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<link rel="stylesheet" href="foreground/css/list.css"> <link rel="stylesheet" href="foreground/css/list.css">
<link rel="stylesheet" href="foreground/css/table.css"> <link rel="stylesheet" href="foreground/css/table.css">
<link rel="stylesheet" href="foreground/css/tree.css"> <link rel="stylesheet" href="foreground/css/tree.css">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<script src="chrome://resources/polymer/v1_0/html-imports/html-imports.min.js"></script> <script src="chrome://resources/polymer/v1_0/html-imports/html-imports.min.js"></script>
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/cros_colors.generated.css"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_colors.generated.css">
<link rel="stylesheet" href="../file_manager/foreground/css/list.css"> <link rel="stylesheet" href="../file_manager/foreground/css/list.css">
<link rel="stylesheet" href="../file_manager/foreground/css/common.css"> <link rel="stylesheet" href="../file_manager/foreground/css/common.css">
<link rel="stylesheet" href="../file_manager/foreground/css/file_types.css"> <link rel="stylesheet" href="../file_manager/foreground/css/file_types.css">
......
...@@ -41,7 +41,7 @@ grit("webui_resources_grd") { ...@@ -41,7 +41,7 @@ grit("webui_resources_grd") {
deps = [ "//ui/webui/resources:modulize" ] deps = [ "//ui/webui/resources:modulize" ]
if (is_chromeos) { if (is_chromeos) {
deps += [ "//ui/webui/resources/css:cros_colors_css" ] deps += [ "//ui/chromeos/colors:cros_colors_css" ]
} }
outputs = [ outputs = [
......
...@@ -209,8 +209,9 @@ without changes to the corresponding grd file. --> ...@@ -209,8 +209,9 @@ without changes to the corresponding grd file. -->
file="html/promise_resolver.html" type="chrome_html" /> file="html/promise_resolver.html" type="chrome_html" />
<if expr="chromeos"> <if expr="chromeos">
<structure name="IDR_WEBUI_CSS_CROS_COLORS" <structure name="IDR_WEBUI_CROS_COLORS_CSS"
file="${root_gen_dir}/ui/webui/resources/css/cros_colors.generated.css" type="chrome_html" file="${root_gen_dir}/ui/chromeos/colors/cros_colors.generated.css"
type="chrome_html"
use_base_dir="false" /> use_base_dir="false" />
</if> </if>
......
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