// Callback for when you press enter in the URL box. void URLEntryActivate(GtkEntry* entry) { if (!g_handler.get() || !g_handler->GetBrowserId()) return; const gchar* url = gtk_entry_get_text(entry); g_handler->GetBrowser()->GetMainFrame()->LoadURL(std::string(url).c_str()); }
// Callback for Debug > Zoom Reset... menu item. gboolean ZoomResetActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) { CefRefPtr<CefBrowser> browser = g_handler->GetBrowser(); browser->GetHost()->SetZoomLevel(0.0); } return FALSE; // Don't stop this message. }
// WebViewDelegate::TakeFocus in the test webview delegate. static gboolean HandleFocus(GtkWidget* widget, GdkEventFocus* focus) { if (g_handler.get() && g_handler->GetBrowserId()) { // Give focus to the browser window. g_handler->GetBrowser()->GetHost()->SetFocus(true); } return TRUE; }
static gboolean HandleQuit(int signatl) { if (!isReallyClosing && g_handler.get() && g_handler->GetBrowserId()) { CefRefPtr<CommandCallback> callback = new CloseWindowCommandCallback(g_handler->GetBrowser()); g_handler->SendJSCommand(g_handler->GetBrowser(), FILE_CLOSE_WINDOW, callback); return TRUE; } destroy(); }
// Callback for Debug > Scheme Handler... menu item. gboolean SchemeHandlerActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) scheme_test::RunTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for Debug > XMLHttpRequest... menu item. gboolean XMLHttpRequestActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) RunXMLHTTPRequestTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for Debug > Local Storage... menu item. gboolean LocalStorageActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) RunLocalStorageTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for when you click the reload button. void ReloadButtonClicked(GtkButton* button) { if (g_handler.get() && g_handler->GetBrowserId()) g_handler->GetBrowser()->Reload(); }
// Callback for when you click the forward button. void ForwardButtonClicked(GtkButton* button) { if (g_handler.get() && g_handler->GetBrowserId()) g_handler->GetBrowser()->GoForward(); }
// Callback for when you click the back button. void BackButtonClicked(GtkButton* button) { if (g_handler.get() && g_handler->GetBrowserId()) g_handler->GetBrowser()->GoBack(); }
// Callback for Debug > HTML5 Drag & Drop... menu item. gboolean HTML5DragDropActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) RunDragDropTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for Debug > Accelerated Layers... menu item. gboolean AcceleratedLayersActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) RunAcceleratedLayersTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for Debug > Popup Window... menu item. gboolean PopupWindowActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) RunPopupTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for Debug > Performance... menu item. gboolean PerformanceActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) performance_test::RunTest(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }
// Callback for when you click the stop button. void StopButtonClicked(GtkButton* button) { if (g_handler.get() && g_handler->GetBrowserId()) g_handler->GetBrowser()->StopLoad(); }
// Callback for Debug > Dialogs... menu item. gboolean DialogsActivated(GtkWidget* widget) { if (g_handler.get() && g_handler->GetBrowserId()) dialog_test::RunTest(g_handler->GetBrowser()); 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()) RunOtherTests(g_handler->GetBrowser()); return FALSE; // Don't stop this message. }