• stanisc's avatar
    Device info datatype should be moved to components/sync_driver. · 1052875a
    stanisc authored
    This change prepares DeviceInfo class (and all other sync
    classes that depend on DeviceInfo and implement DEVICE_INFO
    syncable type) to be moved to components/sync_driver library
    by removing any dependencies on chrome/browser.
    
    To achieve this all chrome/browser specific code was moved to
    LocalDeviceInfoProviderImpl which will stay in browser/sync/glue.
    All other classes including DeviceInfo and LocalDeviceInfoProvider
    should now depend only on base or components. I'll move
    them to components/sync_driver in the next change.
    
    Details:
    
    1) In ui_thread_search_terms_data.cc DeviceInfo::GetLocalDeviceType()
    was used just to find out if the device is an Android phone.
    Since this code has nothing to do with Sync I replaced these
    with direct calls to ui::GetDeviceFormFactor() - that exactly
    what DeviceInfo::GetLocalDeviceType() does internally.
    
    2) In sessions_sync_manager.cc - calling DeviceInfo::GetLocalDeviceType()
    isn't necessary anymore because the local device type can be
    accessed via the owned LocalDeviceInfoProvider instance.
    This allowed me to move GetLocalDeviceType() to LocalDeviceInfoProviderImpl
    and make it private.
    
    3) DeviceInfo::MakeUserAgentForSyncApi() is called only
    from the code that will stay in browser/sync/glue.
    I moved the implemented to LocalDeviceInfoProviderImpl class.
    
    BUG=396136
    
    Review URL: https://codereview.chromium.org/594643003
    
    Cr-Commit-Position: refs/heads/master@{#296267}
    1052875a
sessions_sync_manager.cc 40.9 KB