Ejemplo n.º 1
0
// 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());
}
Ejemplo n.º 2
0
// 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.
}
Ejemplo n.º 3
0
// 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;
}
Ejemplo n.º 4
0
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();
}
Ejemplo n.º 5
0
// 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.
}
Ejemplo n.º 6
0
// 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.
}
Ejemplo n.º 7
0
// 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.
}
Ejemplo n.º 8
0
// Callback for when you click the reload button.
void ReloadButtonClicked(GtkButton* button) {
  if (g_handler.get() && g_handler->GetBrowserId())
    g_handler->GetBrowser()->Reload();
}
Ejemplo n.º 9
0
// Callback for when you click the forward button.
void ForwardButtonClicked(GtkButton* button) {
  if (g_handler.get() && g_handler->GetBrowserId())
    g_handler->GetBrowser()->GoForward();
}
Ejemplo n.º 10
0
// Callback for when you click the back button.
void BackButtonClicked(GtkButton* button) {
  if (g_handler.get() && g_handler->GetBrowserId())
    g_handler->GetBrowser()->GoBack();
}
Ejemplo n.º 11
0
// 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.
}
Ejemplo n.º 12
0
// 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.
}
Ejemplo n.º 13
0
// 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.
}
Ejemplo n.º 14
0
// 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.
}
Ejemplo n.º 15
0
// Callback for when you click the stop button.
void StopButtonClicked(GtkButton* button) {
  if (g_handler.get() && g_handler->GetBrowserId())
    g_handler->GetBrowser()->StopLoad();
}
Ejemplo n.º 16
0
// 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.
}
Ejemplo n.º 17
0
// 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.
}