diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index 1a4898a1b8133..e1b6f337ed623 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc @@ -50,6 +50,7 @@ #include "ui/gfx/path.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/text_elider.h" +#include "ui/gfx/vector_icons_public.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/button/blue_button.h" #include "ui/views/controls/button/image_button.h" diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index f762846888c3a..a0493c5b44162 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -2921,6 +2921,9 @@ }], ['OS!="mac"', { 'sources': [ '<@(chrome_browser_ui_views_non_mac_sources)' ], + 'dependencies': [ + '../ui/gfx/gfx.gyp:gfx_vector_icons', + ], 'conditions': [ ['enable_extensions==1', { 'sources': [ '<@(chrome_browser_ui_views_extensions_non_mac_sources)' ], diff --git a/ui/gfx/gfx.gyp b/ui/gfx/gfx.gyp index 71509a47fc9a5..8f94c0244b4c9 100644 --- a/ui/gfx/gfx.gyp +++ b/ui/gfx/gfx.gyp @@ -408,41 +408,6 @@ 'text_utils_skia.cc', ], }, { # desktop platforms - 'variables': { - 'vector_icons_cc_file': '<(INTERMEDIATE_DIR)/ui/gfx/vector_icons.cc', - 'vector_icons_public_h_file': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/vector_icons_public.h', - }, - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'sources': [ - '<(vector_icons_cc_file)', - '<(vector_icons_public_h_file)', - - 'paint_vector_icon.cc', - 'paint_vector_icon.h', - 'vector_icons.h', - ], - 'actions': [ - { - # GN version: //ui/gfx:aggregate_vector_icons - 'action_name': 'aggregate_vector_icons', - 'inputs': [ - 'vector_icons/', - ], - 'outputs': [ - '<(vector_icons_cc_file)', - '<(vector_icons_public_h_file)', - ], - 'action': [ 'python', - 'vector_icons/aggregate_vector_icons.py', - '--working_directory=vector_icons/', - '--output_cc=<(vector_icons_cc_file)', - '--output_h=<(vector_icons_public_h_file)', - ], - 'message': 'Aggregating vector resources.', - }, - ], }], ['use_x11==1', { 'dependencies': [ @@ -472,6 +437,55 @@ }], ], }, + # Separate from gfx to limit the impact of the hard_dependency. + { + 'target_name': 'gfx_vector_icons', + 'type': '<(component)', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/skia/skia.gyp:skia', + 'gfx', + 'gfx_geometry', + ], + 'defines': [ + 'GFX_IMPLEMENTATION', + ], + 'sources': [ + 'paint_vector_icon.cc', + 'paint_vector_icon.h', + 'vector_icons.h', + ], + 'variables': { + 'vector_icons_cc_file': '<(INTERMEDIATE_DIR)/ui/gfx/vector_icons.cc', + 'vector_icons_public_h_file': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/vector_icons_public.h', + }, + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ], + 'actions': [ + { + # GN version: //ui/gfx:aggregate_vector_icons + 'action_name': 'aggregate_vector_icons', + 'inputs': [ + 'vector_icons/', + ], + 'outputs': [ + '<(vector_icons_cc_file)', + '<(vector_icons_public_h_file)', + ], + 'action': [ 'python', + 'vector_icons/aggregate_vector_icons.py', + '--working_directory=vector_icons/', + '--output_cc=<(vector_icons_cc_file)', + '--output_h=<(vector_icons_public_h_file)', + ], + 'message': 'Aggregating vector resources.', + 'process_outputs_as_sources': 1, + }, + ], + # Export a hard dependency because of generated header files. + 'hard_dependency': 1, + }, { 'target_name': 'gfx_test_support', 'type': 'static_library', diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc index 70dd49a8d7b76..aba0aee14a56a 100644 --- a/ui/views/controls/image_view.cc +++ b/ui/views/controls/image_view.cc @@ -11,6 +11,7 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" +#include "ui/gfx/vector_icons_public.h" #include "ui/views/painter.h" namespace views { diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h index 28a8f07493318..8b038e23295d0 100644 --- a/ui/views/controls/image_view.h +++ b/ui/views/controls/image_view.h @@ -7,11 +7,11 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/image/image_skia.h" -#include "ui/gfx/vector_icons_public.h" #include "ui/views/view.h" namespace gfx { class Canvas; +enum class VectorIconId; } namespace views { diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 3fe9aec60060a..9798c35f32cb0 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -604,6 +604,7 @@ '../events/platform/events_platform.gyp:events_platform', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', + '../gfx/gfx.gyp:gfx_vector_icons', '../native_theme/native_theme.gyp:native_theme', '../resources/ui_resources.gyp:ui_resources', '../strings/ui_strings.gyp:ui_strings',