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 #include <atlbase.h> | 5 #include <atlbase.h> |
6 #include <security.h> | 6 #include <security.h> |
7 | 7 |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <iostream> | 9 #include <iostream> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 cloud_print::LoadLocalString(IDS_ADD_PRINTERS_USING_CHROME); | 344 cloud_print::LoadLocalString(IDS_ADD_PRINTERS_USING_CHROME); |
345 std::cout << "\n" << message.c_str() << "\n" ; | 345 std::cout << "\n" << message.c_str() << "\n" ; |
346 std::string new_contents = | 346 std::string new_contents = |
347 ChromeLauncher::CreateServiceStateFile(proxy_id, printers); | 347 ChromeLauncher::CreateServiceStateFile(proxy_id, printers); |
348 | 348 |
349 if (new_contents.empty()) { | 349 if (new_contents.empty()) { |
350 return ReportError(E_FAIL, IDS_ERROR_FAILED_CREATE_CONFIG); | 350 return ReportError(E_FAIL, IDS_ERROR_FAILED_CREATE_CONFIG); |
351 } | 351 } |
352 | 352 |
353 if (new_contents != contents) { | 353 if (new_contents != contents) { |
354 size_t written = file_util::WriteFile(file, new_contents.c_str(), | 354 size_t written = base::WriteFile(file, new_contents.c_str(), |
355 new_contents.size()); | 355 new_contents.size()); |
356 if (written != new_contents.size()) { | 356 if (written != new_contents.size()) { |
357 return ReportError(cloud_print::GetLastHResult(), | 357 return ReportError(cloud_print::GetLastHResult(), |
358 IDS_ERROR_FAILED_CREATE_CONFIG); | 358 IDS_ERROR_FAILED_CREATE_CONFIG); |
359 } | 359 } |
360 } | 360 } |
361 | 361 |
362 return S_OK; | 362 return S_OK; |
363 } | 363 } |
364 | 364 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 410 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
411 logging::InitLogging(settings); | 411 logging::InitLogging(settings); |
412 | 412 |
413 logging::SetMinLogLevel( | 413 logging::SetMinLogLevel( |
414 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableLogging) ? | 414 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableLogging) ? |
415 logging::LOG_INFO : logging::LOG_FATAL); | 415 logging::LOG_INFO : logging::LOG_FATAL); |
416 | 416 |
417 return _AtlModule.WinMain(0); | 417 return _AtlModule.WinMain(0); |
418 } | 418 } |
419 | 419 |
OLD | NEW |