| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" | 6 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" |
| 7 #include "chrome/common/channel_info.h" | 7 #include "chrome/common/channel_info.h" |
| 8 #include "chrome/common/sync_util.h" | 8 #include "components/sync_driver/sync_util.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "sync/util/get_session_name.h" | 10 #include "sync/util/get_session_name.h" |
| 11 #include "ui/base/device_form_factor.h" | 11 #include "ui/base/device_form_factor.h" |
| 12 | 12 |
| 13 namespace browser_sync { | 13 namespace browser_sync { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 #if defined(OS_ANDROID) | 17 #if defined(OS_ANDROID) |
| 18 bool IsTabletUI() { | 18 bool IsTabletUI() { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 46 LocalDeviceInfoProviderImpl::~LocalDeviceInfoProviderImpl() { | 46 LocalDeviceInfoProviderImpl::~LocalDeviceInfoProviderImpl() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 const sync_driver::DeviceInfo* | 49 const sync_driver::DeviceInfo* |
| 50 LocalDeviceInfoProviderImpl::GetLocalDeviceInfo() const { | 50 LocalDeviceInfoProviderImpl::GetLocalDeviceInfo() const { |
| 51 return local_device_info_.get(); | 51 return local_device_info_.get(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 std::string LocalDeviceInfoProviderImpl::GetSyncUserAgent() const { | 54 std::string LocalDeviceInfoProviderImpl::GetSyncUserAgent() const { |
| 55 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 55 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 56 return MakeDesktopUserAgentForSync(); | 56 return MakeDesktopUserAgentForSync(chrome::GetChannel()); |
| 57 #elif defined(OS_CHROMEOS) | 57 #elif defined(OS_CHROMEOS) |
| 58 return MakeUserAgentForSync("CROS "); | 58 return MakeUserAgentForSync("CROS ", chrome::GetChannel()); |
| 59 #elif defined(OS_ANDROID) | 59 #elif defined(OS_ANDROID) |
| 60 if (IsTabletUI()) { | 60 if (IsTabletUI()) { |
| 61 return MakeUserAgentForSync("ANDROID-TABLET "); | 61 return MakeUserAgentForSync("ANDROID-TABLET ", chrome::GetChannel()); |
| 62 } else { | 62 } else { |
| 63 return MakeUserAgentForSync("ANDROID-PHONE "); | 63 return MakeUserAgentForSync("ANDROID-PHONE ", chrome::GetChannel()); |
| 64 } | 64 } |
| 65 #endif | 65 #endif |
| 66 } | 66 } |
| 67 | 67 |
| 68 std::string LocalDeviceInfoProviderImpl::GetLocalSyncCacheGUID() const { | 68 std::string LocalDeviceInfoProviderImpl::GetLocalSyncCacheGUID() const { |
| 69 return cache_guid_; | 69 return cache_guid_; |
| 70 } | 70 } |
| 71 | 71 |
| 72 scoped_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> | 72 scoped_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> |
| 73 LocalDeviceInfoProviderImpl::RegisterOnInitializedCallback( | 73 LocalDeviceInfoProviderImpl::RegisterOnInitializedCallback( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 99 chrome::GetVersionString(), | 99 chrome::GetVersionString(), |
| 100 GetSyncUserAgent(), | 100 GetSyncUserAgent(), |
| 101 GetLocalDeviceType(), | 101 GetLocalDeviceType(), |
| 102 signin_scoped_device_id)); | 102 signin_scoped_device_id)); |
| 103 | 103 |
| 104 // Notify observers. | 104 // Notify observers. |
| 105 callback_list_.Notify(); | 105 callback_list_.Notify(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace browser_sync | 108 } // namespace browser_sync |
| OLD | NEW |