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

Unified Diff: pdf/out_of_process_instance.cc

Issue 1303103003: PDF: Use PDF metadata for the title instead of the last path element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « chrome/test/data/pdf/title_test.js ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index dbe3968d0ca2d116c0def6159261ed5cf228447c..5f60a4bce286e7abce032d2cf657a4b03d87da62 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -77,9 +77,10 @@ const char kJSPageHeight[] = "height";
// Document load progress arguments (Plugin -> Page)
const char kJSLoadProgressType[] = "loadProgress";
const char kJSProgressPercentage[] = "progress";
-// Bookmarks
-const char kJSBookmarksType[] = "bookmarks";
+// Metadata
+const char kJSMetadataType[] = "metadata";
const char kJSBookmarks[] = "bookmarks";
+const char kJSTitle[] = "title";
// Get password arguments (Plugin -> Page)
const char kJSGetPasswordType[] = "getPassword";
// Get password complete arguments (Page -> Plugin)
@@ -1126,10 +1127,14 @@ void OutOfProcessInstance::DocumentLoadComplete(int page_count) {
OnGeometryChanged(0, 0);
}
- pp::VarDictionary bookmarks_message;
- bookmarks_message.Set(pp::Var(kType), pp::Var(kJSBookmarksType));
- bookmarks_message.Set(pp::Var(kJSBookmarks), engine_->GetBookmarks());
- PostMessage(bookmarks_message);
+ pp::VarDictionary metadata_message;
+ metadata_message.Set(pp::Var(kType), pp::Var(kJSMetadataType));
+ std::string title = engine_->GetMetadata("Title");
+ if (!title.empty())
+ metadata_message.Set(pp::Var(kJSTitle), pp::Var(title));
+
+ metadata_message.Set(pp::Var(kJSBookmarks), engine_->GetBookmarks());
+ PostMessage(metadata_message);
pp::VarDictionary progress_message;
progress_message.Set(pp::Var(kType), pp::Var(kJSLoadProgressType));
« no previous file with comments | « chrome/test/data/pdf/title_test.js ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698