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

Issue 150062: [chromium-reviews] Add getLanguage function to tabs extension (Closed)

Created:
11 years, 5 months ago by sidchat (Google)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, rafaelw
Visibility:
Public.

Description

Add getLanguage function to tab extension. BUG=none TEST=enable extensions using the toolstip.html code (added with this CL) and load pages in different languages. The corresponding language should appear in the bottom left after the page is loadedm or when the button is clicked, or when you navigate back to that tab after visiting some other tab. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20378

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 30

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 5

Patch Set 8 : '' #

Total comments: 3

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 1

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -9 lines) Patch
M chrome/browser/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_browsertests_misc.cc View 9 10 11 12 2 chunks +20 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_function.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +23 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/notification_type.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_api_client_unittest.cc View 9 10 11 12 1 chunk +18 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +26 lines, -1 line 0 comments Download
M chrome/renderer/renderer_resources.grd View 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +11 lines, -0 lines 1 comment Download
A chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/french_sentence.html View 9 10 11 12 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html View 9 10 11 12 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/samples/cld/manifest.json View 1 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/samples/cld/toolstrip.html View 1 2 3 4 5 6 7 8 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
sidchat (Google)
The getLanguage function has to be called explicitly to get the language of the currently ...
11 years, 5 months ago (2009-06-29 22:14:05 UTC) #1
sidchat (Google)
I made changes to the architecture. Language detection now takes place in the browser, and ...
11 years, 5 months ago (2009-06-30 01:37:33 UTC) #2
Aaron Boodman
Very cool. http://codereview.chromium.org/150062/diff/1086/66 File chrome/browser/extensions/extension_tabs_module.cc (right): http://codereview.chromium.org/150062/diff/1086/66#newcode626 Line 626: args_->GetAsInteger(&tab_id); If the argument is not ...
11 years, 5 months ago (2009-06-30 21:53:16 UTC) #3
sidchat (Google)
http://codereview.chromium.org/150062/diff/1086/66 File chrome/browser/extensions/extension_tabs_module.cc (right): http://codereview.chromium.org/150062/diff/1086/66#newcode626 Line 626: args_->GetAsInteger(&tab_id); I had to move stuff in Run() ...
11 years, 5 months ago (2009-07-01 18:27:40 UTC) #4
Aaron Boodman
Getting closer. Ping me on monday if my refactor suggestion doesn't make sense. http://codereview.chromium.org/150062/diff/1119/1124 File ...
11 years, 5 months ago (2009-07-04 09:37:56 UTC) #5
sidchat (Google)
Great suggestions - made changes accordingly - please have a look again. -Sid On 2009/07/04 ...
11 years, 5 months ago (2009-07-06 19:00:22 UTC) #6
sidchat (Google)
Forgot to add - I don't know how to initialize the boolean |initiate_| in class ...
11 years, 5 months ago (2009-07-06 19:02:59 UTC) #7
Aaron Boodman
Ok, getting really close now. Before I give this the LG, can you add some ...
11 years, 5 months ago (2009-07-06 22:08:55 UTC) #8
sidchat (Google)
Made changes as per your suggestions. Also, added unit tests and a browser test. Please ...
11 years, 5 months ago (2009-07-08 18:50:12 UTC) #9
Aaron Boodman
Great! One question below, then lgtm http://codereview.chromium.org/150062/diff/4047/3060 File chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html (right): http://codereview.chromium.org/150062/diff/4047/3060#newcode17 Line 17: window.domAutomationController.send(language == ...
11 years, 5 months ago (2009-07-08 18:56:37 UTC) #10
sidchat (Google)
> http://codereview.chromium.org/150062/diff/4047/3060#newcode17 > Line 17: window.domAutomationController.send(language == 'FRENCH'); > Is it possible to use the ...
11 years, 5 months ago (2009-07-08 19:04:28 UTC) #11
jungshik at Google
http://codereview.chromium.org/150062/diff/3087/4160 File chrome/renderer/resources/extension_process_bindings.js (right): http://codereview.chromium.org/150062/diff/3087/4160#newcode27 Line 27: native function GetTabLanguage(); I'm afraid Get*Language gives a ...
11 years, 5 months ago (2009-07-10 00:38:42 UTC) #12
sidchat (Google)
> I'm afraid Get*Language gives a wrong impression (even though we'll document > about that). ...
11 years, 5 months ago (2009-07-10 18:12:54 UTC) #13
xji
On 2009/07/10 18:12:54, sidchat (Google) wrote: > > I'm afraid Get*Language gives a wrong impression ...
11 years, 5 months ago (2009-07-13 19:49:44 UTC) #14
sidchat (Google)
11 years, 5 months ago (2009-07-14 18:08:55 UTC) #15
I see - OK - from popular requests, let me work on an advanced function that
returns all the three languages with percentages etc.

-Sid

On 2009/07/13 19:49:44, xji wrote:
> On 2009/07/10 18:12:54, sidchat (Google) wrote:
> > > I'm afraid Get*Language gives a wrong impression (even though we'll
document
> > > about that). How about DetectTabLanguage() to make clear that it's not for
> > > reading off the value of 'lang' or 'xml:lang' or 'Content-Language'?
> > Yes, that can done - I will make a separate CL for that.
> > 
> > > 
> > > Also, CLD returns the top 3 languages with the proportion of each in the
> > input.
> > > It appears that this function just returns the top language. Do we want to
> > have
> > > another function for a more advanced usage?
> > I don't see any use of the advanced feature where all the three languages
are
> > returned. When translating a web page, a single "from" language is required.
> Of
> > course, the page may be multilingual - even then, since translation occurs
for
> > each block of text, it still would require the dominant single language to
> > translate from.
> > 
> > Having said that, I may require the advanced API for getting all the three
> > languages for my advanced-spell-check stuff - but they will be internal, and
> not
> > be part of extensions.
> 
> Hi Sid:
> 
> I plan to work on dictionary extension, which will  need CLD extension, and it
> might need the top-3 results (and with reliability) because the language of
the
> word might be difference from the language of the page, especially when the
> detection reliability is low (for mix-language pages).
> 
> This is just a thought. Not final yet. But such information would be useful.
> 
> Thanks,
> Xiaomei

Powered by Google App Engine
This is Rietveld 408576698