| 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/out_of_process_instance.h" | 5 #include "pdf/out_of_process_instance.h" |
| 6 | 6 |
| 7 #include <algorithm> // for min/max() | 7 #include <algorithm> // for min/max() |
| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 paint_manager_.InvalidateRect(pp::Rect(pp::Point(), plugin_size_)); | 401 paint_manager_.InvalidateRect(pp::Rect(pp::Point(), plugin_size_)); |
| 402 } else if (type == kJSLoadPreviewPageType && | 402 } else if (type == kJSLoadPreviewPageType && |
| 403 dict.Get(pp::Var(kJSPreviewPageUrl)).is_string() && | 403 dict.Get(pp::Var(kJSPreviewPageUrl)).is_string() && |
| 404 dict.Get(pp::Var(kJSPreviewPageIndex)).is_int()) { | 404 dict.Get(pp::Var(kJSPreviewPageIndex)).is_int()) { |
| 405 ProcessPreviewPageInfo(dict.Get(pp::Var(kJSPreviewPageUrl)).AsString(), | 405 ProcessPreviewPageInfo(dict.Get(pp::Var(kJSPreviewPageUrl)).AsString(), |
| 406 dict.Get(pp::Var(kJSPreviewPageIndex)).AsInt()); | 406 dict.Get(pp::Var(kJSPreviewPageIndex)).AsInt()); |
| 407 } else if (type == kJSGetAccessibilityJSONType) { | 407 } else if (type == kJSGetAccessibilityJSONType) { |
| 408 pp::VarDictionary reply; | 408 pp::VarDictionary reply; |
| 409 reply.Set(pp::Var(kType), pp::Var(kJSGetAccessibilityJSONReplyType)); | 409 reply.Set(pp::Var(kType), pp::Var(kJSGetAccessibilityJSONReplyType)); |
| 410 if (dict.Get(pp::Var(kJSAccessibilityPageNumber)).is_int()) { | 410 if (dict.Get(pp::Var(kJSAccessibilityPageNumber)).is_int()) { |
| 411 int page = dict.Get(pp::Var(kJSAccessibilityPageNumber)).AsInt(); | 411 int page = pp::Var(kJSAccessibilityPageNumber).AsInt(); |
| 412 reply.Set(pp::Var(kJSAccessibilityJSON), | 412 reply.Set(pp::Var(kJSAccessibilityJSON), |
| 413 pp::Var(engine_->GetPageAsJSON(page))); | 413 pp::Var(engine_->GetPageAsJSON(page))); |
| 414 } else { | 414 } else { |
| 415 base::DictionaryValue node; | 415 base::DictionaryValue node; |
| 416 node.SetInteger(kAccessibleNumberOfPages, engine_->GetNumberOfPages()); | 416 node.SetInteger(kAccessibleNumberOfPages, engine_->GetNumberOfPages()); |
| 417 node.SetBoolean(kAccessibleLoaded, | 417 node.SetBoolean(kAccessibleLoaded, |
| 418 document_load_state_ != LOAD_STATE_LOADING); | 418 document_load_state_ != LOAD_STATE_LOADING); |
| 419 bool has_permissions = | 419 bool has_permissions = |
| 420 engine_->HasPermission(PDFEngine::PERMISSION_COPY) || | 420 engine_->HasPermission(PDFEngine::PERMISSION_COPY) || |
| 421 engine_->HasPermission(PDFEngine::PERMISSION_COPY_ACCESSIBLE); | 421 engine_->HasPermission(PDFEngine::PERMISSION_COPY_ACCESSIBLE); |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 LoadPreviewUrl(url); | 1398 LoadPreviewUrl(url); |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 void OutOfProcessInstance::UserMetricsRecordAction( | 1401 void OutOfProcessInstance::UserMetricsRecordAction( |
| 1402 const std::string& action) { | 1402 const std::string& action) { |
| 1403 // TODO(raymes): Move this function to PPB_UMA_Private. | 1403 // TODO(raymes): Move this function to PPB_UMA_Private. |
| 1404 pp::PDF::UserMetricsRecordAction(this, pp::Var(action)); | 1404 pp::PDF::UserMetricsRecordAction(this, pp::Var(action)); |
| 1405 } | 1405 } |
| 1406 | 1406 |
| 1407 } // namespace chrome_pdf | 1407 } // namespace chrome_pdf |
| OLD | NEW |