| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/glue/device_info.h" | 5 #include "chrome/browser/sync/glue/device_info.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "sync/util/get_session_name.h" | 12 #include "sync/util/get_session_name.h" |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 #if defined(OS_ANDROID) | 18 #if defined(OS_ANDROID) |
| 19 bool IsTabletUI() { | 19 bool IsTabletUI() { |
| 20 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI); | 20 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI); |
| 21 } | 21 } |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 DeviceInfo::DeviceInfo() | |
| 27 : client_name_("Unset"), | |
| 28 sync_user_agent_("Unset"), | |
| 29 device_type_(sync_pb::SyncEnums::TYPE_OTHER) { | |
| 30 } | |
| 31 | |
| 32 DeviceInfo::DeviceInfo(const std::string& client_name, | 26 DeviceInfo::DeviceInfo(const std::string& client_name, |
| 33 const std::string& chrome_version, | 27 const std::string& chrome_version, |
| 34 const std::string& sync_user_agent, | 28 const std::string& sync_user_agent, |
| 35 const sync_pb::SyncEnums::DeviceType device_type) | 29 const sync_pb::SyncEnums::DeviceType device_type) |
| 36 : client_name_(client_name), | 30 : client_name_(client_name), |
| 37 chrome_version_(chrome_version), | 31 chrome_version_(chrome_version), |
| 38 sync_user_agent_(sync_user_agent), | 32 sync_user_agent_(sync_user_agent), |
| 39 device_type_(device_type) { | 33 device_type_(device_type) { |
| 40 } | 34 } |
| 41 | 35 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 DeviceInfo local_info( | 126 DeviceInfo local_info( |
| 133 session_name, | 127 session_name, |
| 134 version_info.CreateVersionString(), | 128 version_info.CreateVersionString(), |
| 135 MakeUserAgentForSyncApi(version_info), | 129 MakeUserAgentForSyncApi(version_info), |
| 136 GetLocalDeviceType()); | 130 GetLocalDeviceType()); |
| 137 | 131 |
| 138 callback.Run(local_info); | 132 callback.Run(local_info); |
| 139 } | 133 } |
| 140 | 134 |
| 141 } // namespace browser_sync | 135 } // namespace browser_sync |
| OLD | NEW |