Add support for printing via CefBrowserHost::Print() and JavaScript window.print() (issue #505).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1479 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-10-23 19:30:47 +00:00
parent f248b937f9
commit bc1ea4974a
35 changed files with 1960 additions and 20 deletions

View File

@ -149,6 +149,14 @@ gboolean EndTracingActivated(GtkWidget* widget) {
return FALSE; // Don't stop this message.
}
// Callback for Tests > Print menu item.
gboolean PrintActivated(GtkWidget* widget) {
if (g_handler.get())
g_handler->GetBrowser()->GetHost()->Print();
return FALSE; // Don't stop this message.
}
// Callback for Tests > Other Tests... menu item.
gboolean OtherTestsActivated(GtkWidget* widget) {
if (g_handler.get() && g_handler->GetBrowserId())
@ -232,6 +240,8 @@ GtkWidget* CreateMenuBar() {
G_CALLBACK(BeginTracingActivated));
AddMenuEntry(debug_menu, "End Tracing",
G_CALLBACK(EndTracingActivated));
AddMenuEntry(debug_menu, "Print",
G_CALLBACK(PrintActivated));
AddMenuEntry(debug_menu, "Other Tests",
G_CALLBACK(OtherTestsActivated));
return menu_bar;