| 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 "pdf/instance.h" | 5 #include "pdf/instance.h" |
| 6 | 6 |
| 7 #include <algorithm> // for min() | 7 #include <algorithm> // for min() |
| 8 #define _USE_MATH_DEFINES // for M_PI | 8 #define _USE_MATH_DEFINES // for M_PI |
| 9 #include <cmath> // for log() and pow() | 9 #include <cmath> // for log() and pow() |
| 10 #include <math.h> | 10 #include <math.h> |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 pp::CompletionCallback callback = | 1380 pp::CompletionCallback callback = |
| 1381 callback_factory_.NewCallback(&Instance::OnPrint); | 1381 callback_factory_.NewCallback(&Instance::OnPrint); |
| 1382 pp::Module::Get()->core()->CallOnMainThread(0, callback); | 1382 pp::Module::Get()->core()->CallOnMainThread(0, callback); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 void Instance::OnPrint(int32_t) { | 1385 void Instance::OnPrint(int32_t) { |
| 1386 pp::PDF::Print(this); | 1386 pp::PDF::Print(this); |
| 1387 } | 1387 } |
| 1388 | 1388 |
| 1389 void Instance::SaveAs() { | 1389 void Instance::SaveAs() { |
| 1390 pp::PDF::SaveAs(this); | 1390 pp::PDF::SaveAs(this, ""); |
| 1391 } | 1391 } |
| 1392 | 1392 |
| 1393 void Instance::SubmitForm(const std::string& url, | 1393 void Instance::SubmitForm(const std::string& url, |
| 1394 const void* data, | 1394 const void* data, |
| 1395 int length) { | 1395 int length) { |
| 1396 pp::URLRequestInfo request(this); | 1396 pp::URLRequestInfo request(this); |
| 1397 request.SetURL(url); | 1397 request.SetURL(url); |
| 1398 request.SetMethod("POST"); | 1398 request.SetMethod("POST"); |
| 1399 request.AppendDataToBody(reinterpret_cast<const char*>(data), length); | 1399 request.AppendDataToBody(reinterpret_cast<const char*>(data), length); |
| 1400 | 1400 |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 return instance_->HasScriptableMethod(name, exception); | 2739 return instance_->HasScriptableMethod(name, exception); |
| 2740 } | 2740 } |
| 2741 | 2741 |
| 2742 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2742 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
| 2743 const std::vector<pp::Var>& args, | 2743 const std::vector<pp::Var>& args, |
| 2744 pp::Var* exception) { | 2744 pp::Var* exception) { |
| 2745 return instance_->CallScriptableMethod(method, args, exception); | 2745 return instance_->CallScriptableMethod(method, args, exception); |
| 2746 } | 2746 } |
| 2747 | 2747 |
| 2748 } // namespace chrome_pdf | 2748 } // namespace chrome_pdf |
| OLD | NEW |