Disable translate when there is no API key
commit8788f3c1260e54476d13d29acc02cf1412bb73f0
authorpaulmiller <paulmiller@chromium.org>
Fri, 17 Jul 2015 18:39:44 +0000 (17 11:39 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 17 Jul 2015 18:42:21 +0000 (17 18:42 +0000)
tree6920dc6455e0740c46a857a046c1d465d8a0a574
parentae67c71852b1daf87e1f3d1661a0519c5e32105c
Disable translate when there is no API key

There is a new ChromePublic.apk target which is to Android Chrome as
desktop Chromium is to desktop Chrome. ChromePublic lacks an API key,
so many Google APIs are not available. I recently surveyed all the
Chrome features which seem to depend an Google APIs. Some still
worked. Most failed gracefully. Translate was the only one that failed
ungracefully; in ChromePublic, the dialog pops up offering to
translate a foreign page, but if you accept, nothing happens. We
should disable translate (not show the dialog) in this case to avoid
this bad UX.

BUG=500025

Review URL: https://codereview.chromium.org/1185703007

Cr-Commit-Position: refs/heads/master@{#339292}
chrome/browser/autofill/autofill_interactive_uitest.cc
chrome/browser/translate/translate_browsertest.cc
chrome/browser/translate/translate_service.cc
components/translate/core/browser/translate_browser_metrics.h
components/translate/core/browser/translate_browser_metrics_unittest.cc
components/translate/core/browser/translate_manager.cc
components/translate/core/browser/translate_manager.h