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 "sync/util/get_session_name.h" | 5 #include "sync/util/get_session_name.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 chromeos::system::StatisticsProvider* provider = | 36 chromeos::system::StatisticsProvider* provider = |
37 chromeos::system::StatisticsProvider::GetInstance(); | 37 chromeos::system::StatisticsProvider::GetInstance(); |
38 if (!provider->GetMachineStatistic(kMachineInfoBoard, &board)) | 38 if (!provider->GetMachineStatistic(kMachineInfoBoard, &board)) |
39 LOG(ERROR) << "Failed to get board information"; | 39 LOG(ERROR) << "Failed to get board information"; |
40 // Currently, only "stumpy" type of board is considered Chromebox, and | 40 // Currently, only "stumpy" type of board is considered Chromebox, and |
41 // anything else is Chromebook. | 41 // anything else is Chromebook. |
42 session_name = (board == "stumpy") ? "Chromebox" : "Chromebook"; | 42 session_name = (board == "stumpy") ? "Chromebox" : "Chromebook"; |
43 #elif defined(OS_LINUX) | 43 #elif defined(OS_LINUX) |
44 session_name = base::GetLinuxDistro(); | 44 session_name = base::GetLinuxDistro(); |
45 #elif defined(OS_MACOSX) | 45 #elif defined(OS_MACOSX) |
46 // session_name = internal::GetHardwareModelName(); | 46 session_name = internal::GetHardwareModelName(); |
47 #elif defined(OS_WIN) | 47 #elif defined(OS_WIN) |
48 session_name = internal::GetComputerName(); | 48 session_name = internal::GetComputerName(); |
49 #elif defined(OS_ANDROID) | 49 #elif defined(OS_ANDROID) |
50 session_name = internal::GetModel(); | 50 session_name = internal::GetModel(); |
51 #endif | 51 #endif |
52 | 52 |
53 if (session_name == "Unknown" || session_name.empty()) | 53 if (session_name == "Unknown" || session_name.empty()) |
54 session_name = base::SysInfo::OperatingSystemName(); | 54 session_name = base::SysInfo::OperatingSystemName(); |
55 | 55 |
56 return session_name; | 56 return session_name; |
(...skipping 22 matching lines...) Expand all Loading... |
79 base::Bind(&OnSessionNameFilled, | 79 base::Bind(&OnSessionNameFilled, |
80 done_callback, | 80 done_callback, |
81 base::Owned(session_name))); | 81 base::Owned(session_name))); |
82 } | 82 } |
83 | 83 |
84 std::string GetSessionNameSynchronouslyForTesting() { | 84 std::string GetSessionNameSynchronouslyForTesting() { |
85 return GetSessionNameSynchronously(); | 85 return GetSessionNameSynchronously(); |
86 } | 86 } |
87 | 87 |
88 } // namespace syncer | 88 } // namespace syncer |
OLD | NEW |