Sync: Allow DeviceInfoTracker listener to be set early.
ProfileSyncService::GetDeviceInfoTracker implementation
returns NULL when DeviceInfo datatype isn't syncing.
This makes it impossible to register DeviceInfo observer
in advance.
This problem was introduced during recent refactoring of
DeviceInfo datatype when all functionality related to
consumption of synced DeviceInfo has been moved to a separate
interface called DeviceInfoTracker.
In fact ProfileSyncService doesn't have to return NULL. It
was done primarily to preserve the previously existing
access pattern to DeviceInfo synced data.
Description of the fix:
1) ProfileSyncService::GetDeviceInfoTracker() now returns
a non-NULL pointer to DeviceInfoTracker regardless of
DeviceInfo datatype state.
2) DeviceInfoTracker.IsSyncing method is used to check
whether DeviceInfo data is available.
3) Made minor changes in UI and extensions code depending on
GetDeviceInfoTracker().
Adding a unit test for this particular scenario at
ProfileSyncService turned out to be non-trivial. However
there are already unit tests for this functionality at
DeviceInfoSyncService level.
I've also tested this code with a demo signedInDevices
API extension.
BUG=446493
Review URL: https://codereview.chromium.org/
843633002
Cr-Commit-Position: refs/heads/master@{#311276}