Chromium Code Reviews| Index: chromeos/network/network_profile.cc |
| diff --git a/chromeos/network/network_profile.cc b/chromeos/network/network_profile.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66d801c571bf307a22e5446fe47249a5aaee6925 |
| --- /dev/null |
| +++ b/chromeos/network/network_profile.cc |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromeos/network/network_profile.h" |
| + |
| +#include "base/stringprintf.h" |
| + |
| +namespace chromeos { |
| + |
| +std::string ProfileToString(const NetworkProfile* profile) { |
| + if (!profile) |
| + return "NetworkProfile(NULL)"; |
| + |
| + std::string result; |
| + switch (profile->type()) { |
| + case NetworkProfile::TYPE_SHARED: |
| + return base::StringPrintf("NetworkProfile(SHARED, %s)", |
| + profile->path.c_str()); |
| + case NetworkProfile::TYPE_USER: |
| + return base::StringPrintf("NetworkProfile(USER, %s, %s)", |
| + profile->path.c_str(), |
| + profile->userhash.c_str()); |
| + } |
|
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.
|
| + return std::string(); |
| +} |
| + |
| +} // namespace chromeos |