Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/browser/sync/glue/local_device_info_provider_impl.cc

Issue 1308313003: Componentize chrome/common/sync_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync/backup_rollback_controller_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698