| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cups/backend.h> | 5 #include <cups/backend.h> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // CommandLine is only setup to enable logging, never used subseqeuently. | 40 // CommandLine is only setup to enable logging, never used subseqeuently. |
| 41 CommandLine::Init(argc, argv); | 41 CommandLine::Init(argc, argv); |
| 42 // Location for the log file. | 42 // Location for the log file. |
| 43 std::string log_location = "/var/log/GCP-Driver.log"; | 43 std::string log_location = "/var/log/GCP-Driver.log"; |
| 44 | 44 |
| 45 // Set up logging. | 45 // Set up logging. |
| 46 logging::InitLogging(log_location.c_str(), | 46 logging::InitLogging(log_location.c_str(), |
| 47 logging::LOG_ONLY_TO_FILE, | 47 logging::LOG_ONLY_TO_FILE, |
| 48 logging::LOCK_LOG_FILE, | 48 logging::LOCK_LOG_FILE, |
| 49 logging::APPEND_TO_OLD_LOG_FILE, | 49 logging::APPEND_TO_OLD_LOG_FILE, |
| 50 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 50 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS, |
| 51 logging::DISABLE_DLOG_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
| 51 | 52 |
| 52 // Temporary directory to hold the output file. | 53 // Temporary directory to hold the output file. |
| 53 FilePath temp_dir; | 54 FilePath temp_dir; |
| 54 // Strings to hold details of current job. | 55 // Strings to hold details of current job. |
| 55 std::string current_user; | 56 std::string current_user; |
| 56 std::string set_var; | 57 std::string set_var; |
| 57 std::string job_title; | 58 std::string job_title; |
| 58 std::string job_id; | 59 std::string job_id; |
| 59 std::string file_name; | 60 std::string file_name; |
| 60 std::string print_ticket; | 61 std::string print_ticket; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 94 |
| 94 // Change back to user to launch Chrome. | 95 // Change back to user to launch Chrome. |
| 95 printer_driver_util::SetUser(argv[2]); | 96 printer_driver_util::SetUser(argv[2]); |
| 96 PLOG(ERROR) << print_ticket; | 97 PLOG(ERROR) << print_ticket; |
| 97 // Launch Chrome and pass the print job onto Cloud Print. | 98 // Launch Chrome and pass the print job onto Cloud Print. |
| 98 printer_driver_util::LaunchPrintDialog(output_path.value(), job_title, | 99 printer_driver_util::LaunchPrintDialog(output_path.value(), job_title, |
| 99 current_user, print_ticket); | 100 current_user, print_ticket); |
| 100 | 101 |
| 101 return 0; | 102 return 0; |
| 102 } | 103 } |
| OLD | NEW |