| 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlapp.h> // NOLINT | 6 #include <atlapp.h> // NOLINT |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 ServiceState service_state; | 382 ServiceState service_state; |
| 383 if (service_state.FromString(contents)) | 383 if (service_state.FromString(contents)) |
| 384 proxy_id = service_state.proxy_id(); | 384 proxy_id = service_state.proxy_id(); |
| 385 } | 385 } |
| 386 PostUITask(base::Bind(&SetupDialog::AskToCloseChrome, this)); | 386 PostUITask(base::Bind(&SetupDialog::AskToCloseChrome, this)); |
| 387 contents = ChromeLauncher::CreateServiceStateFile(proxy_id, setup.printers()); | 387 contents = ChromeLauncher::CreateServiceStateFile(proxy_id, setup.printers()); |
| 388 | 388 |
| 389 if (contents.empty()) | 389 if (contents.empty()) |
| 390 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG); | 390 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG); |
| 391 | 391 |
| 392 size_t written = file_util::WriteFile(file, contents.c_str(), | 392 size_t written = base::WriteFile(file, contents.c_str(), |
| 393 contents.size()); | 393 contents.size()); |
| 394 if (written != contents.size()) { | 394 if (written != contents.size()) { |
| 395 DWORD last_error = GetLastError(); | 395 DWORD last_error = GetLastError(); |
| 396 if (!last_error) | 396 if (!last_error) |
| 397 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG); | 397 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG); |
| 398 return ShowError(HRESULT_FROM_WIN32(last_error)); | 398 return ShowError(HRESULT_FROM_WIN32(last_error)); |
| 399 } | 399 } |
| 400 | 400 |
| 401 hr = controller_.InstallConnectorService(user, password, base::FilePath(), | 401 hr = controller_.InstallConnectorService(user, password, base::FilePath(), |
| 402 enable_logging); | 402 enable_logging); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 base::MessageLoopForUI loop; | 448 base::MessageLoopForUI loop; |
| 449 scoped_refptr<SetupDialog> dialog(new SetupDialog()); | 449 scoped_refptr<SetupDialog> dialog(new SetupDialog()); |
| 450 dialog->Create(NULL); | 450 dialog->Create(NULL); |
| 451 dialog->ShowWindow(SW_SHOW); | 451 dialog->ShowWindow(SW_SHOW); |
| 452 SetupDialog::Dispatcher dispatcher(dialog); | 452 SetupDialog::Dispatcher dispatcher(dialog); |
| 453 base::RunLoop run_loop(&dispatcher); | 453 base::RunLoop run_loop(&dispatcher); |
| 454 run_loop.Run(); | 454 run_loop.Run(); |
| 455 return 0; | 455 return 0; |
| 456 } | 456 } |
| OLD | NEW |