Ensure the DomDistillerViewerSource is registered at startup.
commit7e856dde942357f969d757de61db277395c2c1f9
authornyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 15 Mar 2014 00:34:05 +0000 (15 00:34 +0000)
committernyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 15 Mar 2014 00:34:05 +0000 (15 00:34 +0000)
tree980bc6071c97f23c7c18b5207b68b2511fc4b611
parent922818347fdbf3280183cb246efde7b629e95f77
Ensure the DomDistillerViewerSource is registered at startup.

This changes the registration time of the DomDistillerViewerSource which
handles requests to the chrome-distiller:// scheme. Before this CL, the
URLDataSource was registered as soon as the BrowserContextKeyedService
was requested, which is too late when the user directly tries to distill a URL.
This changes it so that the scheme registration happens as soon as the
profile has been created.

Since the instantiation of the service causes the database for the
DomDistillerStore to load, an instance holder is created which causes the
service to be lazily created when it is needed.

BUG=319881

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257264 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/dom_distiller/dom_distiller_service_factory.cc
chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
chrome/browser/dom_distiller/lazy_dom_distiller_service.cc [new file with mode: 0644]
chrome/browser/dom_distiller/lazy_dom_distiller_service.h [new file with mode: 0644]
chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
chrome/browser/profiles/profile_impl.cc
chrome/chrome_browser.gypi