Refactor TranslateAcceptLanguages as a BrowserContextKeyedService
commit29b787f010e8e53cf0f473dbe52c6a17da476391
authordroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 11 Feb 2014 20:02:18 +0000 (11 20:02 +0000)
committerdroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 11 Feb 2014 20:02:18 +0000 (11 20:02 +0000)
treee49d0c28d22f8c5f46aca68dac142abe2e596599
parent0d97e147adaf3ba0e258921808a016e40a1a0898
Refactor TranslateAcceptLanguages as a BrowserContextKeyedService

This CL refactors TranslateAcceptLanguages as a BrowserContextKeyedService,
and moves it into the Translate component.

The choice of BrowserContextKeyedService seems obvious since there is one
accept languages list per profile.
The existing code is simplified, since the handling of profiles and notifications
is deferred to the BrowserContextKeyedService code and can be removed.

Note that there is now one TranslateAcceptLanguages instance per profile (it
was a singleton owned by TranslateManager previously).

BUG=335076

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250480 0039d316-1c4b-4281-b951-d872f2087c98
13 files changed:
chrome/browser/translate/translate_accept_languages.cc [deleted file]
chrome/browser/translate/translate_accept_languages.h [deleted file]
chrome/browser/translate/translate_accept_languages_factory.cc [new file with mode: 0644]
chrome/browser/translate/translate_accept_languages_factory.h [new file with mode: 0644]
chrome/browser/translate/translate_infobar_delegate.cc
chrome/browser/translate/translate_manager.cc
chrome/browser/translate/translate_manager.h
chrome/browser/translate/translate_prefs.cc
chrome/chrome_browser.gypi
components/translate.gypi
components/translate/core/browser/translate_accept_languages.cc [new file with mode: 0644]
components/translate/core/browser/translate_accept_languages.h [new file with mode: 0644]
tools/gn/secondary/components/translate/BUILD.gn