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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 paint_manager_.InvalidateRect(pp::Rect(pp::Point(), plugin_size_)); | 400 paint_manager_.InvalidateRect(pp::Rect(pp::Point(), plugin_size_)); |
401 } else if (type == kJSLoadPreviewPageType && | 401 } else if (type == kJSLoadPreviewPageType && |
402 dict.Get(pp::Var(kJSPreviewPageUrl)).is_string() && | 402 dict.Get(pp::Var(kJSPreviewPageUrl)).is_string() && |
403 dict.Get(pp::Var(kJSPreviewPageIndex)).is_int()) { | 403 dict.Get(pp::Var(kJSPreviewPageIndex)).is_int()) { |
404 ProcessPreviewPageInfo(dict.Get(pp::Var(kJSPreviewPageUrl)).AsString(), | 404 ProcessPreviewPageInfo(dict.Get(pp::Var(kJSPreviewPageUrl)).AsString(), |
405 dict.Get(pp::Var(kJSPreviewPageIndex)).AsInt()); | 405 dict.Get(pp::Var(kJSPreviewPageIndex)).AsInt()); |
406 } else if (type == kJSGetAccessibilityJSONType) { | 406 } else if (type == kJSGetAccessibilityJSONType) { |
407 pp::VarDictionary reply; | 407 pp::VarDictionary reply; |
408 reply.Set(pp::Var(kType), pp::Var(kJSGetAccessibilityJSONReplyType)); | 408 reply.Set(pp::Var(kType), pp::Var(kJSGetAccessibilityJSONReplyType)); |
409 if (dict.Get(pp::Var(kJSAccessibilityPageNumber)).is_int()) { | 409 if (dict.Get(pp::Var(kJSAccessibilityPageNumber)).is_int()) { |
410 int page = dict.Get(pp::Var(kJSAccessibilityPageNumber)).AsInt(); | 410 int page = pp::Var(kJSAccessibilityPageNumber).AsInt(); |
411 reply.Set(pp::Var(kJSAccessibilityJSON), | 411 reply.Set(pp::Var(kJSAccessibilityJSON), |
412 pp::Var(engine_->GetPageAsJSON(page))); | 412 pp::Var(engine_->GetPageAsJSON(page))); |
413 } else { | 413 } else { |
414 base::DictionaryValue node; | 414 base::DictionaryValue node; |
415 node.SetInteger(kAccessibleNumberOfPages, engine_->GetNumberOfPages()); | 415 node.SetInteger(kAccessibleNumberOfPages, engine_->GetNumberOfPages()); |
416 node.SetBoolean(kAccessibleLoaded, | 416 node.SetBoolean(kAccessibleLoaded, |
417 document_load_state_ != LOAD_STATE_LOADING); | 417 document_load_state_ != LOAD_STATE_LOADING); |
418 bool has_permissions = | 418 bool has_permissions = |
419 engine_->HasPermission(PDFEngine::PERMISSION_COPY) || | 419 engine_->HasPermission(PDFEngine::PERMISSION_COPY) || |
420 engine_->HasPermission(PDFEngine::PERMISSION_COPY_ACCESSIBLE); | 420 engine_->HasPermission(PDFEngine::PERMISSION_COPY_ACCESSIBLE); |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 LoadPreviewUrl(url); | 1389 LoadPreviewUrl(url); |
1390 } | 1390 } |
1391 | 1391 |
1392 void OutOfProcessInstance::UserMetricsRecordAction( | 1392 void OutOfProcessInstance::UserMetricsRecordAction( |
1393 const std::string& action) { | 1393 const std::string& action) { |
1394 // TODO(raymes): Move this function to PPB_UMA_Private. | 1394 // TODO(raymes): Move this function to PPB_UMA_Private. |
1395 pp::PDF::UserMetricsRecordAction(this, pp::Var(action)); | 1395 pp::PDF::UserMetricsRecordAction(this, pp::Var(action)); |
1396 } | 1396 } |
1397 | 1397 |
1398 } // namespace chrome_pdf | 1398 } // namespace chrome_pdf |
OLD | NEW |