summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 21:32:42 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 21:32:42 +0000
commit8dc5a205c581c3adf5aeebf6d4ccb4a9c8176658 (patch)
tree2e0f321db340f08fd2b9ef93eb2120e3baa68a00 /chrome/browser
parent0192d0455dadef14e37ac526bf9902f142f3f592 (diff)
downloadchromium_src-8dc5a205c581c3adf5aeebf6d4ccb4a9c8176658.zip
chromium_src-8dc5a205c581c3adf5aeebf6d4ccb4a9c8176658.tar.gz
chromium_src-8dc5a205c581c3adf5aeebf6d4ccb4a9c8176658.tar.bz2
Reland r36541 (which went in without any commit log by some magic). Was reverted in r36550. Now I'm relanding with the full description.
Port back CLD to Linux and Mac by replacing Windows API calls with ICU's equivalent APIs for normalization. I also fixed bug 23553 (Traditional Chinese is not detected) by calling LanguageCode instead of LanguageCode_ISO_639_1. The latter covers only ISO 639-1, but there are languages detected by CLD not covered by ISO 639-1. In that case, ISO 639-2 is used. In case even ISO 639-2 does not cover (e.g. Traditional Chinese), another fallback is taken by LanguageCode. The html file for CLD testing (french_sentence.html) is explicitly labelled with charset=ISO-8859-1. Original Review: http://codereview.chromium.org/523108 BUG=25206,23553 TEST=1. CLD is built on Linux/Mac 2. The following test pass: - unit_tests: Extension*.DetectTabLang* and CompactLangDet*.* - browser_tests: ExtensionBrowserTest.Toolstrip 3. Install the 'cld extension' in chrome/common/extensions/docs/examples/api/i18n/cld and go to http://news.google.com.tw and 'zh-TW' shows up in the language badge at the upper right (upper-left in he/ar Chrome) corner. TBR=jcampan Review URL: http://codereview.chromium.org/545123 TBR=jshin@chromium.org Review URL: http://codereview.chromium.org/551070 TBR=jshin@chromium.org Review URL: http://codereview.chromium.org/549091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/extension_browsertests_misc.cc8
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc5
2 files changed, 1 insertions, 12 deletions
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index ee5935c..d0409aa 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -89,23 +89,17 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Toolstrip) {
host->render_view_host(), L"", L"testTabsAPI()", &result);
EXPECT_TRUE(result);
-#if defined(OS_WIN)
- // http://crbug.com/29896 - tabs.detectLanguage is Windows only
-
// Test for compact language detection API. First navigate to a (static) html
// file with a French sentence. Then, run the test API in toolstrip1.html to
// actually call the language detection API through the existing extension,
// and verify that the language returned is indeed French.
FilePath language_url = extension_test_data_dir.AppendASCII(
"french_sentence.html");
- ui_test_utils::NavigateToURL(
- browser(),
- GURL(language_url.ToWStringHack()));
+ ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(language_url));
ui_test_utils::ExecuteJavaScriptAndExtractBool(
host->render_view_host(), L"", L"testTabsLanguageAPI()", &result);
EXPECT_TRUE(result);
-#endif
}
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ExtensionViews) {
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 19d2687..8e6bf2f 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -832,11 +832,6 @@ void CaptureVisibleTabFunction::SendResultFromBitmap(
}
bool DetectTabLanguageFunction::RunImpl() {
- #if !defined(OS_WIN)
- error_ = keys::kSupportedInWindowsOnlyError;
- return false;
- #endif
-
int tab_id = 0;
Browser* browser = NULL;
TabContents* contents = NULL;