summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate
Commit message (Collapse)AuthorAgeFilesLines
* Reloading a page would not show a translate infobar.jcampan@chromium.org2010-02-162-1/+53
| | | | | | | | | | | | This CL fixes that bug. BUG=35602, 35482 TEST=Navigate to a page in a foreign language. The tranlate infobar is shown. Reload the page, the infobar should be shown again. Review URL: http://codereview.chromium.org/597065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39106 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the TranslateManager and unit-tests.jcampan@chromium.org2010-02-133-8/+26
| | | | | | | | | | | | | There was a bug that was initialy turning on translate all the time. When fixed it made the unit-tests fail, revealing another bug. The test was calling a virtual method in its constructor, which was bad and not turning on translate for the tests. BUG=None TEST=UI tests, browser tests, unit-tests should pass. Review URL: http://codereview.chromium.org/601069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38995 0039d316-1c4b-4281-b951-d872f2087c98
* Revert my previous fix for UI tests, it breaks the unit-tests.jcampan@chromium.org2010-02-131-1/+1
| | | | | | | | | | BUG=None TEST=None TBR=kuan Review URL: http://codereview.chromium.org/606040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38985 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the UI tests.jcampan@chromium.org2010-02-121-1/+1
| | | | | | | | | | | | The translate manager enabling code was incorrect. BUG=None TEST=UI tests should pass. TBR=kuan Review URL: http://codereview.chromium.org/604042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38983 0039d316-1c4b-4281-b951-d872f2087c98
* Implements the auto-translate on click: if you have translatedjcampan@chromium.org2010-02-123-27/+160
| | | | | | | | | | | | | | | a page and are navigating to a new page in the same language by clicking a link, the new page is automatically translated. In order to do that I moved the language state from the navigation entry to some dedicated class that each TabContents owns. Also added some basic unit-testing for good measure. BUG=35477 TEST=See bug steps. Run unit-tests. Review URL: http://codereview.chromium.org/596092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38961 0039d316-1c4b-4281-b951-d872f2087c98
* first part of fix for dual translate infobarskuan@chromium.org2010-02-121-1/+1
| | | | | | | | | | | | | | | | | bug is caused by 2 problems when happen during reload of a translated page: 1) infobar container was removing the wrong infobar, which this cl fixes. 2) notification NAV_ENTRY_COMMITTED is being processed by translate-manager first, then tab-contents - translate manager would remove all infobars, then add before-translate infobar - tab contents then removes expired infobars -- since a reload renders an infobar irrelevant, the before-translate that just got added during the same notification is removed - b4 this cl, because of the bug in infobar container, dual infobars were displayed - with this cl, removing the correct infobar means no translate infobar is shown, which is also wrong. BUG=35482 TEST=none for now. Review URL: http://codereview.chromium.org/604028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38919 0039d316-1c4b-4281-b951-d872f2087c98
* Don't translate pages which are in the accept language list.jcampan@chromium.org2010-02-112-15/+76
| | | | | | | | | | | | | | BUG=35073 TEST=Add a language (for example French) to the accept list (Options/Under the Hood tab/Change Font and language Settings button/ language tab). Visit a french site (ex: www.voila.fr), the translate info-bar should not be shown. Without restarting Chrome, add Chinese to the accept language list and visit a Chinese site (ex: wwww.baidu.com), the info-bar should not be shown. Review URL: http://codereview.chromium.org/602009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38822 0039d316-1c4b-4281-b951-d872f2087c98
* translate infobars: reimplement, fix bugskuan@chromium.org2010-02-105-189/+149
| | | | | | | | | | | | | - 35077: redesign and reimplement infobars and infobars delegates to merge before- and after-translate infobars into one, whose state transitions from before-translate to translating to after-translate - 35080: modify gradient of blue infobar per roma (to differentiate from default chrome theme) - 35052: fix white-pixel lines in infobar buttons by stretching image sets instead of tiling them BUG=35052,35080,35077 TEST=verify per all bug reports. Review URL: http://codereview.chromium.org/604001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38704 0039d316-1c4b-4281-b951-d872f2087c98
* Don't show a translate infobar when the page is in a languagejcampan@chromium.org2010-02-031-0/+3
| | | | | | | | | | | | not supported by the translation server. BUG=34365 TEST=Visit http://www.breizh.net/brezhoneg/, no translation infobar should be shown. Review URL: http://codereview.chromium.org/568028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38010 0039d316-1c4b-4281-b951-d872f2087c98
* a little code cleanup for translate infobarskuan@chromium.org2010-02-032-1/+8
| | | | | | | | | | | - use index of selected language menu item (which corresponds to index in array of languages) to check if selection has changed; was retrieving, converting and comparing text, which is more expensive and slower - only call backend to translate when source and target languages are different BUG=31297 TEST=verify that selection of languages in translate infobars still work as expected. Review URL: http://codereview.chromium.org/563018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37979 0039d316-1c4b-4281-b951-d872f2087c98
* Some minor change to the translate classes to address the remarksjcampan@chromium.org2010-02-031-6/+8
| | | | | | | | | | | | from Jungshik review: http://codereview.chromium.org/552216/show TEST=None BUG=None Review URL: http://codereview.chromium.org/566024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37976 0039d316-1c4b-4281-b951-d872f2087c98
* Translating from the English locale would translate to Afrikaans.jcampan@chromium.org2010-02-021-1/+1
| | | | | | | | | | | | | | | This is because the English locale 'en-US' would not match the English language code 'en' and we would default to the 1st language, Afrikaan. BUG=None TEST=Test that translate when Chrome is configured in English (US and UK), Spanish, Portuguese (Brazil and Portugal) does translate to the language Chrome is configured to be in. TBR=kuan Review URL: http://codereview.chromium.org/563005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37813 0039d316-1c4b-4281-b951-d872f2087c98
* implement proper localized display names for translate languageskuan@chromium.org2010-02-024-89/+79
| | | | | | | | | | - in the process, modify to use indexes into vector of languages to communicate between infobars and delegates BUG=31297 TEST=verify that language names in translate infobars' language buttons, dropdown lists and options are properly localized. Review URL: http://codereview.chromium.org/566012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37809 0039d316-1c4b-4281-b951-d872f2087c98
* The "after infobar" could be sticky in some cases.jcampan@chromium.org2010-02-011-0/+11
| | | | | | | | | | | Make sure we always remove it before showing a new "before translate" infobar. BUG=34076 TEST=See bug. Review URL: http://codereview.chromium.org/552258 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37746 0039d316-1c4b-4281-b951-d872f2087c98
* Relanding the hooking of the translate feature UI.jcampan@chromium.org2010-02-013-4/+161
| | | | | | | | See http://codereview.chromium.org/549217 Review URL: http://codereview.chromium.org/558065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37688 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 37674 - Hooking the UI part to the translate feature.jcampan@chromium.org2010-01-313-161/+4
| | | | | | | | | Review URL: http://codereview.chromium.org/549217 TBR=jcampan@chromium.org Review URL: http://codereview.chromium.org/555195 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37675 0039d316-1c4b-4281-b951-d872f2087c98
* Hooking the UI part to the translate feature.jcampan@chromium.org2010-01-313-4/+161
| | | | | | Review URL: http://codereview.chromium.org/549217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37674 0039d316-1c4b-4281-b951-d872f2087c98
* use stubs for yet-to-be-implemented non-windows translate infobarskuan@chromium.org2010-01-291-0/+14
| | | | | | | | BUG=31297 TEST=none. Review URL: http://codereview.chromium.org/557064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37567 0039d316-1c4b-4281-b951-d872f2087c98
* implement infobars and delegates placeholders for translate feature.kuan@chromium.org2010-01-278-0/+662
Review URL: http://codereview.chromium.org/546132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37281 0039d316-1c4b-4281-b951-d872f2087c98