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 "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // POSIX Command line string types are different. | 154 // POSIX Command line string types are different. |
155 CommandLine::StringType native_switch_val; | 155 CommandLine::StringType native_switch_val; |
156 native_switch_val = command_line.GetSwitchValueASCII(switchName); | 156 native_switch_val = command_line.GetSwitchValueASCII(switchName); |
157 // Convert the ASCII string to UTF16 to prepare to pass. | 157 // Convert the ASCII string to UTF16 to prepare to pass. |
158 return string16(ASCIIToUTF16(native_switch_val)); | 158 return string16(ASCIIToUTF16(native_switch_val)); |
159 #endif | 159 #endif |
160 } | 160 } |
161 | 161 |
162 void CloudPrintDataSenderHelper::CallJavascriptFunction( | 162 void CloudPrintDataSenderHelper::CallJavascriptFunction( |
163 const std::wstring& function_name) { | 163 const std::wstring& function_name) { |
164 web_ui_->CallJavascriptFunction(WideToASCII(function_name)); | 164 web_ui_->CallJavascriptFunction(base::WideToASCII(function_name)); |
165 } | 165 } |
166 | 166 |
167 void CloudPrintDataSenderHelper::CallJavascriptFunction( | 167 void CloudPrintDataSenderHelper::CallJavascriptFunction( |
168 const std::wstring& function_name, const Value& arg) { | 168 const std::wstring& function_name, const Value& arg) { |
169 web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg); | 169 web_ui_->CallJavascriptFunction(base::WideToASCII(function_name), arg); |
170 } | 170 } |
171 | 171 |
172 void CloudPrintDataSenderHelper::CallJavascriptFunction( | 172 void CloudPrintDataSenderHelper::CallJavascriptFunction( |
173 const std::wstring& function_name, const Value& arg1, const Value& arg2) { | 173 const std::wstring& function_name, const Value& arg1, const Value& arg2) { |
174 web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg1, arg2); | 174 web_ui_->CallJavascriptFunction(base::WideToASCII(function_name), arg1, arg2); |
175 } | 175 } |
176 | 176 |
177 void CloudPrintDataSenderHelper::CallJavascriptFunction( | 177 void CloudPrintDataSenderHelper::CallJavascriptFunction( |
178 const std::wstring& function_name, | 178 const std::wstring& function_name, |
179 const Value& arg1, | 179 const Value& arg1, |
180 const Value& arg2, | 180 const Value& arg2, |
181 const Value& arg3) { | 181 const Value& arg3) { |
182 web_ui_->CallJavascriptFunction( | 182 web_ui_->CallJavascriptFunction( |
183 WideToASCII(function_name), arg1, arg2, arg3); | 183 base::WideToASCII(function_name), arg1, arg2, arg3); |
184 } | 184 } |
185 | 185 |
186 // Clears out the pointer we're using to communicate. Either routine is | 186 // Clears out the pointer we're using to communicate. Either routine is |
187 // potentially expensive enough that stopping whatever is in progress | 187 // potentially expensive enough that stopping whatever is in progress |
188 // is worth it. | 188 // is worth it. |
189 void CloudPrintDataSender::CancelPrintDataFile() { | 189 void CloudPrintDataSender::CancelPrintDataFile() { |
190 base::AutoLock lock(lock_); | 190 base::AutoLock lock(lock_); |
191 // We don't own helper, it was passed in to us, so no need to | 191 // We don't own helper, it was passed in to us, so no need to |
192 // delete, just let it go. | 192 // delete, just let it go. |
193 helper_ = NULL; | 193 helper_ = NULL; |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 print_job_print_ticket, | 835 print_job_print_ticket, |
836 file_type, | 836 file_type, |
837 delete_on_close); | 837 delete_on_close); |
838 return true; | 838 return true; |
839 } | 839 } |
840 } | 840 } |
841 return false; | 841 return false; |
842 } | 842 } |
843 | 843 |
844 } // end namespace | 844 } // end namespace |
OLD | NEW |