Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chromeos/network/network_profile.h" | |
| 6 | |
| 7 #include "base/stringprintf.h" | |
| 8 | |
| 9 namespace chromeos { | |
| 10 | |
| 11 std::string ProfileToString(const NetworkProfile* profile) { | |
| 12 if (!profile) | |
| 13 return "NetworkProfile(NULL)"; | |
| 14 | |
| 15 std::string result; | |
| 16 switch (profile->type()) { | |
| 17 case NetworkProfile::TYPE_SHARED: | |
| 18 return base::StringPrintf("NetworkProfile(SHARED, %s)", | |
| 19 profile->path.c_str()); | |
| 20 case NetworkProfile::TYPE_USER: | |
| 21 return base::StringPrintf("NetworkProfile(USER, %s, %s)", | |
| 22 profile->path.c_str(), | |
| 23 profile->userhash.c_str()); | |
| 24 } | |
|
stevenjb
2013/04/26 21:00:49
nit: Also better as if/else
Also, if only for logg
pneubeck (no reviews)
2013/04/29 18:05:51
Done.
| |
| 25 return std::string(); | |
| 26 } | |
| 27 | |
| 28 } // namespace chromeos | |
| OLD | NEW |