Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Issue 1374773002: Componentize script to generate UI string overrides mapping. (Closed)

Created:
5 years, 2 months ago by sdefresne
Modified:
5 years, 2 months ago
CC:
asvitkine+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@get-resources-index
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Componentize script to generate UI string overrides mapping. Change the API of the script to generate both the header and source file and to take a list of header files as input (to allow overridding strings from components/components_strings.grd). The script is now generating a method CreateUIStringOverrider() and hides the arrays in the implementation file and allow customization of the namespace in which the function and code is generated. Introduce a new target "chrome_ui_string_overrider_factory" in the gyp build to mimic the same target in the gn build (compiles the source file generated by the script). Rename the script from to generate_ui_string_overrider.py to reflect the new role of the script and move it to components/variations/service. Introduce .gni file to help using the script by different embedders (don't introduce .gypi files as it is much harder to share code for gyp). Componentize ui_string_overrider_unittest.cc. BUG=534257 Committed: https://crrev.com/a213cebe6af1a80367336908d37f30ab6542940d Cr-Commit-Position: refs/heads/master@{#352308}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use dictionary for string interpolation #

Patch Set 3 : Rebase and fix //components/variations:unit_tests build with gn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+483 lines, -428 lines) Patch
M chrome/app/BUILD.gn View 1 chunk +0 lines, -32 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/metrics/metrics_services_manager.cc View 2 chunks +2 lines, -4 lines 0 comments Download
A chrome/browser/metrics/variations/BUILD.gn View 1 chunk +18 lines, -0 lines 0 comments Download
D chrome/browser/metrics/variations/generate_resources_map.py View 1 chunk +0 lines, -183 lines 0 comments Download
D chrome/browser/metrics/variations/generate_resources_map_unittest.py View 1 chunk +0 lines, -93 lines 0 comments Download
M chrome/browser/metrics/variations/generated_resources_map.h View 1 1 chunk +0 lines, -35 lines 0 comments Download
D chrome/browser/metrics/variations/ui_string_overrider_unittest.cc View 1 chunk +0 lines, -45 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 chunks +2 lines, -6 lines 0 comments Download
M chrome/chrome_resources.gyp View 1 chunk +25 lines, -7 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/variations/service/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A components/variations/service/generate_ui_string_overrider.gni View 1 chunk +66 lines, -0 lines 0 comments Download
A components/variations/service/generate_ui_string_overrider.py View 1 1 chunk +292 lines, -0 lines 0 comments Download
A + components/variations/service/generate_ui_string_overrider_unittest.py View 4 chunks +51 lines, -12 lines 0 comments Download
M components/variations/service/ui_string_overrider.h View 1 chunk +1 line, -1 line 0 comments Download
A + components/variations/service/ui_string_overrider_unittest.cc View 2 chunks +22 lines, -7 lines 0 comments Download

Messages

Total messages: 19 (5 generated)
sdefresne
Please take a look. Note that the unit tests for generate_ui_string_overrider.py (formerly generate_resources_map.py) still pass ...
5 years, 2 months ago (2015-09-28 17:00:58 UTC) #3
sdefresne
Note, the generated files looks like this: $ cat out/Debug/gen/chrome/browser/metrics/variations/ui_string_overrider_factory.h // This file was generated ...
5 years, 2 months ago (2015-09-28 17:04:32 UTC) #4
Alexei Svitkine (slow)
+jwd, could you help review?
5 years, 2 months ago (2015-09-28 17:29:44 UTC) #6
jwd
https://codereview.chromium.org/1374773002/diff/20001/chrome/browser/metrics/variations/generated_resources_map.h File chrome/browser/metrics/variations/generated_resources_map.h (right): https://codereview.chromium.org/1374773002/diff/20001/chrome/browser/metrics/variations/generated_resources_map.h#newcode1 chrome/browser/metrics/variations/generated_resources_map.h:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
5 years, 2 months ago (2015-09-29 15:02:54 UTC) #7
sdefresne
Please take another look. https://codereview.chromium.org/1374773002/diff/20001/chrome/browser/metrics/variations/generated_resources_map.h File chrome/browser/metrics/variations/generated_resources_map.h (right): https://codereview.chromium.org/1374773002/diff/20001/chrome/browser/metrics/variations/generated_resources_map.h#newcode1 chrome/browser/metrics/variations/generated_resources_map.h:1: // Copyright 2014 The Chromium ...
5 years, 2 months ago (2015-09-30 09:38:43 UTC) #8
sdefresne
jwd: ping?
5 years, 2 months ago (2015-10-01 09:19:00 UTC) #9
sdefresne
On 2015/10/01 at 09:19:00, sdefresne wrote: > jwd: ping? BTW, failures of win bots are ...
5 years, 2 months ago (2015-10-01 10:00:56 UTC) #10
jwd
lgtm
5 years, 2 months ago (2015-10-01 21:50:40 UTC) #11
sdefresne
jwd: thank you for the review asvitkine: can you do OWNERS review (jwd review is ...
5 years, 2 months ago (2015-10-02 09:55:24 UTC) #13
James Hawkins
lgtm
5 years, 2 months ago (2015-10-02 15:07:14 UTC) #14
Alexei Svitkine (slow)
lgtm
5 years, 2 months ago (2015-10-02 16:35:16 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1374773002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1374773002/60001
5 years, 2 months ago (2015-10-05 08:31:59 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:60001)
5 years, 2 months ago (2015-10-05 09:23:48 UTC) #18
commit-bot: I haz the power
5 years, 2 months ago (2015-10-05 09:24:45 UTC) #19
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a213cebe6af1a80367336908d37f30ab6542940d
Cr-Commit-Position: refs/heads/master@{#352308}

Powered by Google App Engine
This is Rietveld 408576698