Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: pdf/instance.cc

Issue 617163002: Add a getSelectedText method to the PDF plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index a71d071ba9cb7fc5e1a104c0424251770dd8cdce..8ec4a9e7e365c4243da41af98ee536c936c7ec83 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -76,6 +76,7 @@ const char kJSGetHeight[] = "getHeight";
const char kJSGetHorizontalScrollbarThickness[] =
"getHorizontalScrollbarThickness";
const char kJSGetPageLocationNormalized[] = "getPageLocationNormalized";
+const char kJSGetSelectedText[] = "getSelectedText";
const char kJSGetVerticalScrollbarThickness[] = "getVerticalScrollbarThickness";
const char kJSGetWidth[] = "getWidth";
const char kJSGetZoomLevel[] = "getZoomLevel";
@@ -1683,6 +1684,7 @@ bool Instance::HasScriptableMethod(const pp::Var& method, pp::Var* exception) {
method_str == kJSGetHeight ||
method_str == kJSGetHorizontalScrollbarThickness ||
method_str == kJSGetPageLocationNormalized ||
+ method_str == kJSGetSelectedText ||
method_str == kJSGetVerticalScrollbarThickness ||
method_str == kJSGetWidth ||
method_str == kJSGetZoomLevel ||
@@ -1806,6 +1808,9 @@ pp::Var Instance::CallScriptableMethod(const pp::Var& method,
return pp::Var(
v_scrollbar_.get() ? GetScrollbarReservedThickness() : 0);
}
+ if (method_str == kJSGetSelectedText) {
+ return GetSelectedText(false);
+ }
if (method_str == kJSDocumentLoadComplete) {
return pp::Var((document_load_state_ != LOAD_STATE_LOADING));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698