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

Issue 3026016: New pyauto hook for the translate feature. (Closed)

Created:
10 years, 5 months ago by Alyssa
Modified:
9 years, 7 months ago
Reviewers:
Nirnimesh
CC:
chromium-reviews, ben+cc_chromium.org, Paweł Hajdan Jr., krisr, John Grabowski, Jay Civelli
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

New pyauto hook for the translate feature. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53791

Patch Set 1 : Initial #

Total comments: 16

Patch Set 2 : Added my tests - will upload other changes later #

Total comments: 14

Patch Set 3 : Large Revision #

Total comments: 4

Patch Set 4 : typo #

Total comments: 31

Patch Set 5 : Small changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+496 lines, -0 lines) Patch
M chrome/browser/automation/automation_provider.h View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 2 chunks +129 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.h View 1 2 2 chunks +42 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.cc View 1 2 3 4 2 chunks +78 lines, -0 lines 0 comments Download
M chrome/test/functional/PYAUTO_TESTS View 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/functional/translate.py View 2 3 4 1 chunk +138 lines, -0 lines 0 comments Download
M chrome/test/pyautolib/pyauto.py View 1 2 3 4 1 chunk +95 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Alyssa
10 years, 5 months ago (2010-07-22 02:19:39 UTC) #1
Nirnimesh
Haven't looked at it too carefully. Expecting large changes. Please add a sample test in ...
10 years, 5 months ago (2010-07-22 07:29:39 UTC) #2
Jay Civelli
http://codereview.chromium.org/3026016/diff/9001/6002 File chrome/browser/automation/automation_provider.cc (right): http://codereview.chromium.org/3026016/diff/9001/6002#newcode2630 chrome/browser/automation/automation_provider.cc:2630: return translate_bar; Nit: you could probably do without the ...
10 years, 5 months ago (2010-07-22 16:28:43 UTC) #3
Alyssa
http://codereview.chromium.org/3026016/diff/4001/1006 File chrome/browser/automation/automation_provider.cc (right): http://codereview.chromium.org/3026016/diff/4001/1006#newcode2638 chrome/browser/automation/automation_provider.cc:2638: void AutomationProvider::IsPageTranslated(Browser* browser, On 2010/07/22 07:29:39, Nirnimesh wrote: > ...
10 years, 5 months ago (2010-07-23 21:27:45 UTC) #4
Jay Civelli
LGTM http://codereview.chromium.org/3026016/diff/26001/27003 File chrome/browser/automation/automation_provider_observers.cc (right): http://codereview.chromium.org/3026016/diff/26001/27003#newcode954 chrome/browser/automation/automation_provider_observers.cc:954: registrar_.RemoveAll(); Nit: I don't think you need to ...
10 years, 5 months ago (2010-07-23 22:01:30 UTC) #5
Nirnimesh
LGTM, mostly small comments http://codereview.chromium.org/3026016/diff/30001/31001 File chrome/browser/automation/automation_provider.cc (right): http://codereview.chromium.org/3026016/diff/30001/31001#newcode2665 chrome/browser/automation/automation_provider.cc:2665: // Get the TabContents from ...
10 years, 5 months ago (2010-07-24 00:02:48 UTC) #6
Alyssa
10 years, 5 months ago (2010-07-26 17:46:29 UTC) #7
Thanks for the comments!

http://codereview.chromium.org/3026016/diff/26001/27003
File chrome/browser/automation/automation_provider_observers.cc (right):

http://codereview.chromium.org/3026016/diff/26001/27003#newcode954
chrome/browser/automation/automation_provider_observers.cc:954:
registrar_.RemoveAll();
On 2010/07/23 22:01:30, Jay Civelli wrote:
> Nit: I don't think you need to do that.

Done.

http://codereview.chromium.org/3026016/diff/26001/27003#newcode1005
chrome/browser/automation/automation_provider_observers.cc:1005:
registrar_.RemoveAll();
On 2010/07/23 22:01:30, Jay Civelli wrote:
> Nit: same as above

Done.

http://codereview.chromium.org/3026016/diff/30001/31001
File chrome/browser/automation/automation_provider.cc (right):

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2665
chrome/browser/automation/automation_provider.cc:2665: // Get the TabContents
from the dictionary of arguments.
On 2010/07/24 00:02:49, Nirnimesh wrote:
> nit: "the dictionary" -> "a dictionary"

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2666
chrome/browser/automation/automation_provider.cc:2666: TabContents*
GetTabContentsFromDict(const Browser& browser,
On 2010/07/24 00:02:49, Nirnimesh wrote:
> nit: Keep it consistent. pass const Browser* & const DictionaryValue*

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2677
chrome/browser/automation/automation_provider.cc:2677: *error_message = "No tab
at that index.";
On 2010/07/24 00:02:49, Nirnimesh wrote:
> *error_message = StringPrintf("No tab at index %d", tab_index)

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2683
chrome/browser/automation/automation_provider.cc:2683: // Get the
TranslateInfoBarDelegate from the TabContents.
On 2010/07/24 00:02:49, Nirnimesh wrote:
> nit: "the TabContents" -> "TabContents"

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2691
chrome/browser/automation/automation_provider.cc:2691: // If there was no
translate info bar delegate, return null.
On 2010/07/24 00:02:49, Nirnimesh wrote:
> replace with: "no translate infobar". the "return null" part is evident

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2725
chrome/browser/automation/automation_provider.cc:2725:
Details<std::string>(&language));
On 2010/07/24 00:02:49, Nirnimesh wrote:
> Function returns without calling either SendError or SendSuccess.
> Will cause DCHECK crash in AutomationJSONReply's destructor.
> 
> Fix: replace reply.SendError(..) above with AutomationJSONReply(this,
> reply_message).SendError(..)

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2758
chrome/browser/automation/automation_provider.cc:2758: if (option == "never
translate language") {
On 2010/07/24 00:02:49, Nirnimesh wrote:
> maybe we should underscore these strings
> never_translate_language, never_translate_site, ...

Done.

http://codereview.chromium.org/3026016/diff/30001/31001#newcode2778
chrome/browser/automation/automation_provider.cc:2778:
translate_bar->Translate();
On 2010/07/24 00:02:49, Nirnimesh wrote:
> this success condition will cause DCHECK crash for the same reason as above

Done.

http://codereview.chromium.org/3026016/diff/30001/31006
File chrome/test/functional/translate.py (right):

http://codereview.chromium.org/3026016/diff/30001/31006#newcode131
chrome/test/functional/translate.py:131:
self.assertTrue(translate_info['can_translate_page'])
On 2010/07/24 00:02:49, Nirnimesh wrote:
> match something in page contents too

Page contents (as retrieved by "view page source") don't change - they always
stay in the original language.

Powered by Google App Engine
This is Rietveld 408576698