| 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 "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" | 5 #include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" |
| 6 #include <winspool.h> | 6 #include <winspool.h> |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 cloud_print::kCloudPrintRegKey, | 58 cloud_print::kCloudPrintRegKey, |
| 59 KEY_ALL_ACCESS); | 59 KEY_ALL_ACCESS); |
| 60 key.DeleteValue(cloud_print::kChromeExePathRegValue); | 60 key.DeleteValue(cloud_print::kChromeExePathRegValue); |
| 61 key.DeleteValue(cloud_print::kChromeProfilePathRegValue); | 61 key.DeleteValue(cloud_print::kChromeProfilePathRegValue); |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual void CreateTempChromeExeFiles() { | 64 virtual void CreateTempChromeExeFiles() { |
| 65 base::FilePath path; | 65 base::FilePath path; |
| 66 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); | 66 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); |
| 67 base::FilePath main_path = path.Append(kChromeExePath); | 67 base::FilePath main_path = path.Append(kChromeExePath); |
| 68 ASSERT_TRUE(file_util::CreateDirectory(main_path)); | 68 ASSERT_TRUE(base::CreateDirectory(main_path)); |
| 69 base::FilePath alternate_path = path.Append(kAlternateChromeExePath); | 69 base::FilePath alternate_path = path.Append(kAlternateChromeExePath); |
| 70 ASSERT_TRUE(file_util::CreateDirectory(alternate_path)); | 70 ASSERT_TRUE(base::CreateDirectory(alternate_path)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual void DeleteTempChromeExeFiles() { | 73 virtual void DeleteTempChromeExeFiles() { |
| 74 base::FilePath path; | 74 base::FilePath path; |
| 75 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); | 75 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); |
| 76 base::FilePath main_path = path.Append(kChromeExePath); | 76 base::FilePath main_path = path.Append(kChromeExePath); |
| 77 ASSERT_TRUE(base::DeleteFile(main_path, true)); | 77 ASSERT_TRUE(base::DeleteFile(main_path, true)); |
| 78 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); | 78 PathService::Get(base::DIR_LOCAL_APP_DATA, &path); |
| 79 base::FilePath alternate_path = path.Append(kAlternateChromeExePath); | 79 base::FilePath alternate_path = path.Append(kAlternateChromeExePath); |
| 80 ASSERT_TRUE(base::DeleteFile(alternate_path, true)); | 80 ASSERT_TRUE(base::DeleteFile(alternate_path, true)); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 EXPECT_TRUE(monitor2->pfnEndDocPort(port_handle)); | 265 EXPECT_TRUE(monitor2->pfnEndDocPort(port_handle)); |
| 266 RevertToSelf(); | 266 RevertToSelf(); |
| 267 EXPECT_TRUE(monitor2->pfnClosePort != NULL); | 267 EXPECT_TRUE(monitor2->pfnClosePort != NULL); |
| 268 EXPECT_TRUE(monitor2->pfnClosePort(port_handle)); | 268 EXPECT_TRUE(monitor2->pfnClosePort(port_handle)); |
| 269 // Shutdown the port monitor. | 269 // Shutdown the port monitor. |
| 270 Monitor2Shutdown(monitor_handle); | 270 Monitor2Shutdown(monitor_handle); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace cloud_print | 273 } // namespace cloud_print |
| 274 | 274 |
| OLD | NEW |