| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cloud_print/service/win/service_utils.h" | 5 #include "cloud_print/service/win/service_utils.h" |
| 6 #include "google_apis/gaia/gaia_switches.h" | 6 #include "google_apis/gaia/gaia_switches.h" |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <security.h> // NOLINT | 9 #include <security.h> // NOLINT |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ::GetUserNameEx(::NameSamCompatible, NULL, &size); | 41 ::GetUserNameEx(::NameSamCompatible, NULL, &size); |
| 42 result.resize(size); | 42 result.resize(size); |
| 43 if (result.empty()) | 43 if (result.empty()) |
| 44 return result; | 44 return result; |
| 45 if (!::GetUserNameEx(::NameSamCompatible, &result[0], &size)) | 45 if (!::GetUserNameEx(::NameSamCompatible, &result[0], &size)) |
| 46 return base::string16(); | 46 return base::string16(); |
| 47 result.resize(size); | 47 result.resize(size); |
| 48 return result; | 48 return result; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void CopyChromeSwitchesFromCurrentProcess(CommandLine* destination) { | 51 void CopyChromeSwitchesFromCurrentProcess(base::CommandLine* destination) { |
| 52 static const char* const kSwitchesToCopy[] = { | 52 static const char* const kSwitchesToCopy[] = { |
| 53 switches::kCloudPrintURL, | 53 switches::kCloudPrintURL, |
| 54 switches::kCloudPrintXmppEndpoint, | 54 switches::kCloudPrintXmppEndpoint, |
| 55 switches::kEnableCloudPrintXps, | 55 switches::kEnableCloudPrintXps, |
| 56 switches::kEnableLogging, | 56 switches::kEnableLogging, |
| 57 switches::kIgnoreUrlFetcherCertRequests, | 57 switches::kIgnoreUrlFetcherCertRequests, |
| 58 switches::kLsoUrl, | 58 switches::kLsoUrl, |
| 59 switches::kV, | 59 switches::kV, |
| 60 }; | 60 }; |
| 61 destination->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), | 61 destination->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), |
| 62 kSwitchesToCopy, | 62 kSwitchesToCopy, |
| 63 arraysize(kSwitchesToCopy)); | 63 arraysize(kSwitchesToCopy)); |
| 64 } | 64 } |
| 65 | 65 |
| OLD | NEW |