Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: cloud_print/service/win/service_utils.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 if (result.empty()) 21 if (result.empty())
22 return result; 22 return result;
23 if (!::GetComputerName(&result[0], &size)) 23 if (!::GetComputerName(&result[0], &size))
24 return base::string16(); 24 return base::string16();
25 result.resize(size); 25 result.resize(size);
26 return result; 26 return result;
27 } 27 }
28 28
29 base::string16 ReplaceLocalHostInName(const base::string16& user_name) { 29 base::string16 ReplaceLocalHostInName(const base::string16& user_name) {
30 static const wchar_t kLocalDomain[] = L".\\"; 30 static const wchar_t kLocalDomain[] = L".\\";
31 if (base::StartsWith(user_name, kLocalDomain, true)) { 31 if (base::StartsWith(user_name, kLocalDomain,
32 base::CompareCase::SENSITIVE)) {
32 return GetLocalComputerName() + 33 return GetLocalComputerName() +
33 user_name.substr(arraysize(kLocalDomain) - 2); 34 user_name.substr(arraysize(kLocalDomain) - 2);
34 } 35 }
35 return user_name; 36 return user_name;
36 } 37 }
37 38
38 base::string16 GetCurrentUserName() { 39 base::string16 GetCurrentUserName() {
39 ULONG size = 0; 40 ULONG size = 0;
40 base::string16 result; 41 base::string16 result;
41 ::GetUserNameEx(::NameSamCompatible, NULL, &size); 42 ::GetUserNameEx(::NameSamCompatible, NULL, &size);
(...skipping 14 matching lines...) Expand all
56 switches::kEnableLogging, 57 switches::kEnableLogging,
57 switches::kIgnoreUrlFetcherCertRequests, 58 switches::kIgnoreUrlFetcherCertRequests,
58 switches::kLsoUrl, 59 switches::kLsoUrl,
59 switches::kV, 60 switches::kV,
60 }; 61 };
61 destination->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), 62 destination->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
62 kSwitchesToCopy, 63 kSwitchesToCopy,
63 arraysize(kSwitchesToCopy)); 64 arraysize(kSwitchesToCopy));
64 } 65 }
65 66
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | components/devtools_http_handler/devtools_http_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698