diff options
author | sidchat@chromium.org <sidchat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 00:44:58 +0000 |
---|---|---|
committer | sidchat@chromium.org <sidchat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 00:44:58 +0000 |
commit | e2be3ca8bd073fa3e8d16f5f01451e83a9763a94 (patch) | |
tree | 673b4e6e70199d58b831bb8f7eb8983e116e6cf1 | |
parent | 8fb867ac9f72438e75b008f7925525390fb97530 (diff) | |
download | chromium_src-e2be3ca8bd073fa3e8d16f5f01451e83a9763a94.zip chromium_src-e2be3ca8bd073fa3e8d16f5f01451e83a9763a94.tar.gz chromium_src-e2be3ca8bd073fa3e8d16f5f01451e83a9763a94.tar.bz2 |
Language detection works only for Windows now. Make chrome.tabs.detectLanguage return default (English) for non-Windows OS. Review URL: http://codereview.chromium.org/199064
BUG=www.crbug.com/20692
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26529 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index bc4cbe1..5cd4242 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -676,7 +676,7 @@ bool MoveTabFunction::RunImpl() { if (new_index != tab_index) source_tab_strip->MoveTabContentsAt(tab_index, new_index, false); - + if (has_callback()) result_.reset(ExtensionTabUtil::CreateTabValue(contents, source_tab_strip, new_index)); @@ -796,6 +796,11 @@ bool CaptureVisibleTabFunction::RunImpl() { } bool DetectTabLanguageFunction::RunImpl() { + #if !defined(OS_WIN) + error_ = keys::kSupportedInWindowsOnlyError; + return false; + #endif + int tab_id = 0; Browser* browser = NULL; TabContents* contents = NULL; diff --git a/chrome/browser/extensions/extension_tabs_module_constants.cc b/chrome/browser/extensions/extension_tabs_module_constants.cc index a143e44..7f28314 100644 --- a/chrome/browser/extensions/extension_tabs_module_constants.cc +++ b/chrome/browser/extensions/extension_tabs_module_constants.cc @@ -44,6 +44,7 @@ const char kInternalVisibleTabCaptureError[] = const char kNotImplementedError[] = "This call is not yet implemented"; const char kCannotAccessPageError[] = "Cannot access contents of url \"*\". " "Extension manifest must request permission to access this host."; +const char kSupportedInWindowsOnlyError[] = "Supported in Windows only"; const char kGetWindowFunction[] = "windows.get"; const char kGetCurrentWindowFunction[] = "windows.getCurrent"; diff --git a/chrome/browser/extensions/extension_tabs_module_constants.h b/chrome/browser/extensions/extension_tabs_module_constants.h index 574389a..f22b48d 100644 --- a/chrome/browser/extensions/extension_tabs_module_constants.h +++ b/chrome/browser/extensions/extension_tabs_module_constants.h @@ -48,6 +48,7 @@ extern const char kInvalidUrlError[]; extern const char kInternalVisibleTabCaptureError[]; extern const char kNotImplementedError[]; extern const char kCannotAccessPageError[]; +extern const char kSupportedInWindowsOnlyError[]; // Function names, Windows API. extern const char kGetWindowFunction[]; |