Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 570007: Replace __MSG_some_name__ template within extension css/html files with local... (Closed)

Created:
10 years, 10 months ago by Nebojša Ćirić
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw+cc_chromium.org, ben+cc_chromium.org, Erik does not do reviews, jam, Aaron Boodman, pam+watch_chromium.org, darin (slow to review), jungshik at Google
Visibility:
Public.

Description

Replace __MSG_some_name__ template within extension css files with localized messages. We avoid replacing messages within html and js extension files for security reasons. Also, developers can already localize messages in html/js using chrome.i18n.getMessage calls. TEST=Localize extension, try body{direction: __MSG_@@bidi_reversed_dir__;} in popup.css, while using non-rtl locale. Text should be alligned to the right (as if we were using rtl locale). BUG=26144 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=38717

Patch Set 1 #

Total comments: 11

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 1

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+732 lines, -50 lines) Patch
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 2 3 1 chunk +10 lines, -7 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/extension_l10n_util.h View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_l10n_util.cc View 1 2 3 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_l10n_util_unittest.cc View 3 2 chunks +96 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_message_bundle.h View 1 2 3 2 chunks +27 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_message_bundle.cc View 1 2 3 3 chunks +27 lines, -1 line 0 comments Download
M chrome/common/extensions/extension_message_bundle_unittest.cc View 3 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/common/extensions/extension_message_filter_peer.h View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/common/extensions/extension_message_filter_peer.cc View 1 2 3 1 chunk +130 lines, -0 lines 0 comments Download
A chrome/common/extensions/extension_message_filter_peer_unittest.cc View 3 1 chunk +260 lines, -0 lines 0 comments Download
M chrome/common/filter_policy.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/resource_dispatcher.h View 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/common/resource_dispatcher.cc View 1 2 3 4 chunks +28 lines, -14 lines 0 comments Download
M chrome/renderer/extensions/renderer_extension_bindings.cc View 1 2 3 4 chunks +0 lines, -25 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
Nebojša Ćirić
CL is not ready for review (missing tests), but I wanted to get early opinion ...
10 years, 10 months ago (2010-02-03 19:45:40 UTC) #1
Matt Perry
http://codereview.chromium.org/570007/diff/1/11 File chrome/common/resource_dispatcher.cc (right): http://codereview.chromium.org/570007/diff/1/11#newcode336 chrome/common/resource_dispatcher.cc:336: new_peer = ExtensionMessageFilterPeer::CreateExtensionMessageFilterPeer( I think the request_info has the ...
10 years, 10 months ago (2010-02-03 21:34:02 UTC) #2
Nebojša Ćirić
ResourceLoaderBridge::RequestInfo struct has url member, but I have access only to the ResourceDispatcher::PendingRequestInfo which hasn't ...
10 years, 10 months ago (2010-02-03 22:01:43 UTC) #3
wtc
I looked at the files you asked me to review. I am not familiar with ...
10 years, 10 months ago (2010-02-04 20:29:48 UTC) #4
jcampan
http://codereview.chromium.org/570007/diff/1/7 File chrome/common/extensions/extension_message_bundle.cc (right): http://codereview.chromium.org/570007/diff/1/7#newcode310 chrome/common/extensions/extension_message_bundle.cc:310: } else { Nit: else is unecessary. http://codereview.chromium.org/570007/diff/1/8 File ...
10 years, 10 months ago (2010-02-04 21:25:19 UTC) #5
Nebojša Ćirić
All nits done. I'll add tests and ping you again when it's ready. wtc - ...
10 years, 10 months ago (2010-02-05 00:53:54 UTC) #6
Nebojša Ćirić
I've added tests, it's ready for review.
10 years, 10 months ago (2010-02-08 22:31:49 UTC) #7
Nebojša Ćirić
Both wtc and jshin recommended abarth as a good reviewer for this CL, so I've ...
10 years, 10 months ago (2010-02-08 23:44:11 UTC) #8
abarth-chromium
I'll take a look at this CL this evening.
10 years, 10 months ago (2010-02-08 23:56:57 UTC) #9
Matt Perry
> - Change IPCResourceLoaderBridge::Start to pass url_ to > AddPendingRequest(...)... I would prefer this approach. ...
10 years, 10 months ago (2010-02-09 01:15:56 UTC) #10
abarth-chromium
Woah, this is crazy. Are we sure we want to do this? I can't think ...
10 years, 10 months ago (2010-02-09 02:10:35 UTC) #11
abarth-chromium
http://codereview.chromium.org/570007/diff/7001/7004 File chrome/common/extensions/extension_message_filter_peer.cc (right): http://codereview.chromium.org/570007/diff/7001/7004#newcode38 chrome/common/extensions/extension_message_filter_peer.cc:38: StartsWithASCII(mime_type, "text/html", false)) What about XML? application/html+xml? What about ...
10 years, 10 months ago (2010-02-09 16:07:14 UTC) #12
Nebojša Ćirić
Abarth and I chatted offline about this CL, and decided to restrict string replacements only ...
10 years, 10 months ago (2010-02-09 18:33:26 UTC) #13
Nebojša Ćirić
mpcomplete: - got rid of GetURLForDebugging call. I am passing request.url down to the filter. ...
10 years, 10 months ago (2010-02-09 20:28:38 UTC) #14
Matt Perry
LGTM
10 years, 10 months ago (2010-02-09 20:34:47 UTC) #15
Erik does not do reviews
On Tue, Feb 9, 2010 at 10:33 AM, <cira@chromium.org> wrote: > Abarth and I chatted ...
10 years, 10 months ago (2010-02-09 22:58:26 UTC) #16
Nebojša Ćirić
On Tue, Feb 9, 2010 at 2:58 PM, Erik Kay <erikkay@chromium.org> wrote: > On Tue, ...
10 years, 10 months ago (2010-02-09 23:16:02 UTC) #17
abarth-chromium
On Tue, Feb 9, 2010 at 3:15 PM, Nebojša Ćirić <cira@chromium.org> wrote: > On Tue, ...
10 years, 10 months ago (2010-02-09 23:28:28 UTC) #18
Erik does not do reviews
On Tue, Feb 9, 2010 at 3:27 PM, Adam Barth <abarth@chromium.org> wrote: > On Tue, ...
10 years, 10 months ago (2010-02-10 00:02:15 UTC) #19
Nebojša Ćirić
> > 1) There's not a whole lot of user-generated content inlined into CSS. >> ...
10 years, 10 months ago (2010-02-10 00:13:55 UTC) #20
Erik does not do reviews
On Tue, Feb 9, 2010 at 4:13 PM, Nebojša Ćirić <cira@chromium.org> wrote: > 1) There's ...
10 years, 10 months ago (2010-02-10 00:21:06 UTC) #21
Nebojša Ćirić
Ah, sorry. It would replace all __MSG_whatever__ within loaded html file. So all of this ...
10 years, 10 months ago (2010-02-10 00:29:55 UTC) #22
Erik does not do reviews
On Tue, Feb 9, 2010 at 4:29 PM, Nebojša Ćirić <cira@chromium.org> wrote: > Ah, sorry. ...
10 years, 10 months ago (2010-02-10 00:54:47 UTC) #23
Nebojša Ćirić
This hook replaces text just before it gets handled to WebKit. So I think: document.getElementById("foo").innerHTML ...
10 years, 10 months ago (2010-02-10 01:03:19 UTC) #24
Erik does not do reviews
On Tue, Feb 9, 2010 at 5:03 PM, Nebojša Ćirić <cira@chromium.org> wrote: > This hook ...
10 years, 10 months ago (2010-02-10 01:22:36 UTC) #25
Nebojša Ćirić
The CSS data loading doesn't work (message doesn't get replaced). It has to be external ...
10 years, 10 months ago (2010-02-10 01:41:27 UTC) #26
Nebojša Ćirić
Erik, are you ok with current implementation?
10 years, 10 months ago (2010-02-10 18:39:53 UTC) #27
Erik does not do reviews
Yes. I didn't look at the code though. I'll defer to Adam, Matt and Jay ...
10 years, 10 months ago (2010-02-10 18:53:35 UTC) #28
Nebojša Ćirić
Thanks, Matt already gave LGTM, waiting on Adam and Jay (no rush). On 2010/02/10 18:53:35, ...
10 years, 10 months ago (2010-02-10 22:22:47 UTC) #29
jcampan
LGTM
10 years, 10 months ago (2010-02-10 22:24:54 UTC) #30
abarth-chromium
10 years, 10 months ago (2010-02-11 00:14:29 UTC) #31
Looks fine to me.

Adam


On Wed, Feb 10, 2010 at 2:24 PM,  <jcampan@chromium.org> wrote:
> LGTM
>
> http://codereview.chromium.org/570007
>

Powered by Google App Engine
This is Rietveld 408576698