| 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/chrome_version_info.h" | 7 #include "chrome/common/chrome_version_info.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "sync/util/get_session_name.h" | 9 #include "sync/util/get_session_name.h" |
| 10 #include "ui/base/device_form_factor.h" | 10 #include "ui/base/device_form_factor.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 user_agent += "ANDROID-PHONE "; | 80 user_agent += "ANDROID-PHONE "; |
| 81 #elif defined(OS_LINUX) | 81 #elif defined(OS_LINUX) |
| 82 user_agent += "LINUX "; | 82 user_agent += "LINUX "; |
| 83 #elif defined(OS_FREEBSD) | 83 #elif defined(OS_FREEBSD) |
| 84 user_agent += "FREEBSD "; | 84 user_agent += "FREEBSD "; |
| 85 #elif defined(OS_OPENBSD) | 85 #elif defined(OS_OPENBSD) |
| 86 user_agent += "OPENBSD "; | 86 user_agent += "OPENBSD "; |
| 87 #elif defined(OS_MACOSX) | 87 #elif defined(OS_MACOSX) |
| 88 user_agent += "MAC "; | 88 user_agent += "MAC "; |
| 89 #endif | 89 #endif |
| 90 if (!version_info.is_valid()) { | |
| 91 DLOG(ERROR) << "Unable to create chrome::VersionInfo object"; | |
| 92 return user_agent; | |
| 93 } | |
| 94 | |
| 95 user_agent += version_info.Version(); | 90 user_agent += version_info.Version(); |
| 96 user_agent += " (" + version_info.LastChange() + ")"; | 91 user_agent += " (" + version_info.LastChange() + ")"; |
| 97 if (!version_info.IsOfficialBuild()) { | 92 if (!version_info.IsOfficialBuild()) { |
| 98 user_agent += "-devel"; | 93 user_agent += "-devel"; |
| 99 } else { | 94 } else { |
| 100 user_agent += | 95 user_agent += |
| 101 " channel(" + ChannelToString(version_info.GetChannel()) + ")"; | 96 " channel(" + ChannelToString(version_info.GetChannel()) + ")"; |
| 102 } | 97 } |
| 103 | 98 |
| 104 return user_agent; | 99 return user_agent; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 version_info.CreateVersionString(), | 140 version_info.CreateVersionString(), |
| 146 MakeUserAgentForSyncApi(version_info), | 141 MakeUserAgentForSyncApi(version_info), |
| 147 GetLocalDeviceType(), | 142 GetLocalDeviceType(), |
| 148 signin_scoped_device_id)); | 143 signin_scoped_device_id)); |
| 149 | 144 |
| 150 // Notify observers. | 145 // Notify observers. |
| 151 callback_list_.Notify(); | 146 callback_list_.Notify(); |
| 152 } | 147 } |
| 153 | 148 |
| 154 } // namespace browser_sync | 149 } // namespace browser_sync |
| OLD | NEW |