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 // Work around warning in atlbase.h | 5 // Work around warning in atlbase.h |
6 // https://connect.microsoft.com/VisualStudio/feedback/details/1032199/atlbase-h
-gives-warning-c4189-when-compiling-with-atl-no-com-support | 6 // https://connect.microsoft.com/VisualStudio/feedback/details/1032199/atlbase-h
-gives-warning-c4189-when-compiling-with-atl-no-com-support |
7 #pragma warning(push) | 7 #pragma warning(push) |
8 #pragma warning(disable:4189) | 8 #pragma warning(disable:4189) |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #pragma warning(pop) | 10 #pragma warning(pop) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 std::cout << "\n"; | 83 std::cout << "\n"; |
84 } | 84 } |
85 std::cout << "\n"; | 85 std::cout << "\n"; |
86 } | 86 } |
87 | 87 |
88 base::string16 GetOption(int string_id, | 88 base::string16 GetOption(int string_id, |
89 const base::string16& default_option, | 89 const base::string16& default_option, |
90 bool secure) { | 90 bool secure) { |
91 base::string16 prompt_format = cloud_print::LoadLocalString(string_id); | 91 base::string16 prompt_format = cloud_print::LoadLocalString(string_id); |
92 std::vector<base::string16> substitutions(1, default_option); | 92 std::vector<base::string16> substitutions(1, default_option); |
93 std::cout << ReplaceStringPlaceholders(prompt_format, substitutions, NULL); | 93 std::cout << |
| 94 base::ReplaceStringPlaceholders(prompt_format, substitutions, NULL); |
94 base::string16 tmp; | 95 base::string16 tmp; |
95 if (secure) { | 96 if (secure) { |
96 DWORD saved_mode = 0; | 97 DWORD saved_mode = 0; |
97 // Don't close. | 98 // Don't close. |
98 HANDLE stdin_handle = ::GetStdHandle(STD_INPUT_HANDLE); | 99 HANDLE stdin_handle = ::GetStdHandle(STD_INPUT_HANDLE); |
99 ::GetConsoleMode(stdin_handle, &saved_mode); | 100 ::GetConsoleMode(stdin_handle, &saved_mode); |
100 ::SetConsoleMode(stdin_handle, saved_mode & ~ENABLE_ECHO_INPUT); | 101 ::SetConsoleMode(stdin_handle, saved_mode & ~ENABLE_ECHO_INPUT); |
101 std::getline(std::wcin, tmp); | 102 std::getline(std::wcin, tmp); |
102 ::SetConsoleMode(stdin_handle, saved_mode); | 103 ::SetConsoleMode(stdin_handle, saved_mode); |
103 std::cout << "\n"; | 104 std::cout << "\n"; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 418 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
418 logging::InitLogging(settings); | 419 logging::InitLogging(settings); |
419 | 420 |
420 logging::SetMinLogLevel( | 421 logging::SetMinLogLevel( |
421 command_line->HasSwitch(switches::kEnableLogging) ? | 422 command_line->HasSwitch(switches::kEnableLogging) ? |
422 logging::LOG_INFO : logging::LOG_FATAL); | 423 logging::LOG_INFO : logging::LOG_FATAL); |
423 | 424 |
424 return _AtlModule.WinMain(0); | 425 return _AtlModule.WinMain(0); |
425 } | 426 } |
426 | 427 |
OLD | NEW |