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

Issue 174116: chrome.i18n API (accept languages part 1) (Closed)

Created:
11 years, 4 months ago by xji
Modified:
11 years, 3 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), brettw, jam, Ben Goodger (Google), jungshik at Google
Visibility:
Public.

Description

Added chrome.i18n extension API. The API proposal doc is http://sites.google.com/a/chromium.org/dev/developers/design-documents/extensions/i18n-api This CL only adds the getter of accept languages: chrome.i18n.getAcceptLanguages(). The setter of accept languages will be added in a separate CL. BUG=http://crbug.com/14574 TEST=TEST=There is an extension in chrome\test\data\extensions\samples\i18n. Load this extension. It creates a toolstrip button. Click this button, you should get chrome's accept languages. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=25810

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 1

Patch Set 4 : '' #

Total comments: 4

Patch Set 5 : '' #

Total comments: 1

Patch Set 6 : '' #

Total comments: 4

Patch Set 7 : '' #

Total comments: 4

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -1 line) Patch
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 4 5 6 7 3 chunks +6 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_i18n_api.h View 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_i18n_api.cc View 2 3 4 5 6 1 chunk +59 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_i18n_apitest.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/common_resources.grd View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/i18n.html View 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_api_client_unittest.cc View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/i18n/manifest.json View 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/i18n/test.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/i18n/test.js View 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/samples/i18n/manifest.json View 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/samples/i18n/toolstrip.html View 2 3 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
xji
11 years, 4 months ago (2009-08-20 01:29:55 UTC) #1
xji
Just a reminder ....
11 years, 4 months ago (2009-08-26 19:15:04 UTC) #2
Erik does not do reviews
Sorry for the delay. I'll get to this now. Erik On Wed, Aug 26, 2009 ...
11 years, 3 months ago (2009-08-28 16:23:51 UTC) #3
Erik does not do reviews
I realize that this is giving you conflicting direction to what Nick suggested on your ...
11 years, 3 months ago (2009-08-28 16:33:58 UTC) #4
xji
Hi Erik, Thanks for the review! I've updated the CL per your comments and changed ...
11 years, 3 months ago (2009-09-01 19:41:34 UTC) #5
Erik does not do reviews
Please also add a browser_tests API test. See extension_bookmarks_apitest.cc and test/data/extensions/api_test/bookmarks for a sample. http://codereview.chromium.org/174116/diff/5001/5004 ...
11 years, 3 months ago (2009-09-03 16:42:11 UTC) #6
xji
On 2009/09/03 16:42:11, Erik Kay wrote: > Please also add a browser_tests API test. See ...
11 years, 3 months ago (2009-09-03 19:10:36 UTC) #7
Erik does not do reviews
On Thu, Sep 3, 2009 at 12:10 PM, <xji@chromium.org> wrote: > On 2009/09/03 16:42:11, Erik ...
11 years, 3 months ago (2009-09-03 19:40:09 UTC) #8
xji
Updated the patch with 1. change the return type of chrome.i18n.getAcceptLanguages() from string to array ...
11 years, 3 months ago (2009-09-04 21:20:13 UTC) #9
Erik does not do reviews
I'm not sure how defensive we need to be about the formatting of this string. ...
11 years, 3 months ago (2009-09-04 21:50:50 UTC) #10
xji
Updated per review feedback. On 2009/09/04 21:50:50, Erik Kay wrote: > I'm not sure how ...
11 years, 3 months ago (2009-09-08 17:47:04 UTC) #11
Erik does not do reviews
http://codereview.chromium.org/174116/diff/12004/13011 File chrome/browser/extensions/extension_i18n_api.cc (right): http://codereview.chromium.org/174116/diff/12004/13011#newcode28 Line 28: // spaces. But we did not do any ...
11 years, 3 months ago (2009-09-08 21:56:57 UTC) #12
xji
Updated per feedback. Thanks for review again! On 2009/09/08 21:56:57, Erik Kay wrote: > http://codereview.chromium.org/174116/diff/12004/13011 ...
11 years, 3 months ago (2009-09-09 18:10:14 UTC) #13
Erik does not do reviews
LGTM http://codereview.chromium.org/174116/diff/7006/7015 File chrome/browser/extensions/extension_i18n_api.cc (right): http://codereview.chromium.org/174116/diff/7006/7015#newcode50 Line 50: // ending with ','. I don't think ...
11 years, 3 months ago (2009-09-09 18:24:45 UTC) #14
xji
http://codereview.chromium.org/174116/diff/7006/7015 File chrome/browser/extensions/extension_i18n_api.cc (right): http://codereview.chromium.org/174116/diff/7006/7015#newcode50 Line 50: // ending with ','. On 2009/09/09 18:24:45, Erik ...
11 years, 3 months ago (2009-09-09 18:43:57 UTC) #15
Erik does not do reviews
11 years, 3 months ago (2009-09-09 18:46:39 UTC) #16
http://codereview.chromium.org/174116/diff/7006/7015
File chrome/browser/extensions/extension_i18n_api.cc (right):

http://codereview.chromium.org/174116/diff/7006/7015#newcode50
Line 50: // ending with ','.
On 2009/09/09 18:43:57, xji wrote:
> On 2009/09/09 18:24:45, Erik Kay wrote:
> > I don't think this is true.  It guards against a single char value of any
kind
> > right?  I assume that single char language values aren't legal, so this
still
> > seems like a reasonable check, just not an accurate comment.
> 
> It guards against ',' at the end of the string.
> 
> Given a string with a single char value "a", its begin=0, end=npos,
substr="a",
> and it exits the loop due to "end=npos". No possibility to crash.
> 
> Given a string ending with ',' such as "en,",
> its begin=0, end=2, substr="en", then, begin=3,
> we should exit the loop by "begin >= 3".

yep.  you're right.  my math was off.

Powered by Google App Engine
This is Rietveld 408576698