Chromium Code Reviews| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 pp::Module::Get()->AddPluginInterface(kPPPPdfInterface, &ppp_private); | 300 pp::Module::Get()->AddPluginInterface(kPPPPdfInterface, &ppp_private); |
| 301 AddPerInstanceObject(kPPPPdfInterface, this); | 301 AddPerInstanceObject(kPPPPdfInterface, this); |
| 302 | 302 |
| 303 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_MOUSE); | 303 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_MOUSE); |
| 304 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL); | 304 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL); |
| 305 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); | 305 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); |
| 306 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_TOUCH); | 306 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_TOUCH); |
| 307 } | 307 } |
| 308 | 308 |
| 309 Instance::~Instance() { | 309 Instance::~Instance() { |
| 310 engine_->ClientDestroyed(); | |
|
jam
2014/07/31 22:22:32
why not just engine_.reset() here?
| |
| 310 RemovePerInstanceObject(kPPPPdfInterface, this); | 311 RemovePerInstanceObject(kPPPPdfInterface, this); |
| 311 } | 312 } |
| 312 | 313 |
| 313 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { | 314 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { |
| 314 // For now, we hide HiDPI support behind a flag. | 315 // For now, we hide HiDPI support behind a flag. |
| 315 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) | 316 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) |
| 316 hidpi_enabled_ = true; | 317 hidpi_enabled_ = true; |
| 317 | 318 |
| 318 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING); | 319 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING); |
| 319 if (printing_enabled_) { | 320 if (printing_enabled_) { |
| (...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2723 return instance_->HasScriptableMethod(name, exception); | 2724 return instance_->HasScriptableMethod(name, exception); |
| 2724 } | 2725 } |
| 2725 | 2726 |
| 2726 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2727 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
| 2727 const std::vector<pp::Var>& args, | 2728 const std::vector<pp::Var>& args, |
| 2728 pp::Var* exception) { | 2729 pp::Var* exception) { |
| 2729 return instance_->CallScriptableMethod(method, args, exception); | 2730 return instance_->CallScriptableMethod(method, args, exception); |
| 2730 } | 2731 } |
| 2731 | 2732 |
| 2732 } // namespace chrome_pdf | 2733 } // namespace chrome_pdf |
| OLD | NEW |