WebCore:
authorkjk <kjk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2007 01:09:17 +0000 (01:09 +0000)
committerkjk <kjk@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2007 01:09:17 +0000 (01:09 +0000)
        Reviewed by Brady Edison.

        Linux/gdk fix.

        * loader/gdk/FrameLoaderClientGdk.cpp:
        (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
        that FrameLoader:goBackOrForwards() works.

  WebKitTools:

        Reviewed by Brady Edison.

        Add forward/backward/quit menus for easier testing.

        * GdkLauncher/main.cpp:
        (menuMainBackCb):
        (menuMainForwardCb):
        (menuMainQuitCb):
        (main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/gdk/FrameLoaderClientGdk.cpp
WebKitTools/ChangeLog
WebKitTools/GdkLauncher/main.cpp

index 0f93931..e147909 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Brady Edison.
+
+        Linux/gdk fix.
+
+        * loader/gdk/FrameLoaderClientGdk.cpp:
+        (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
+        that FrameLoader:goBackOrForwards() works.
+
 2007-03-10  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Darin Adler.
index 23d2579..e7d559f 100644 (file)
@@ -236,6 +236,14 @@ void FrameLoaderClientGdk::restoreViewState()
     notImplementedGdk(); 
 }
 
+bool FrameLoaderClientGdk::shouldGoToHistoryItem(HistoryItem* item) const 
+{
+    // FIXME: This is a very simple implementation. More sophisticated
+    // implementation would delegate the decision to a PolicyDelegate.
+    // See mac implementation for example.
+    return item != 0;
+}
+
 bool FrameLoaderClientGdk::privateBrowsingEnabled() const { notImplementedGdk(); return false; }
 void FrameLoaderClientGdk::makeDocumentView() { notImplementedGdk(); }
 void FrameLoaderClientGdk::makeRepresentation(DocumentLoader*) { notImplementedGdk(); }
@@ -303,6 +311,5 @@ void FrameLoaderClientGdk::setMainDocumentError(DocumentLoader*, const ResourceE
 void FrameLoaderClientGdk::startDownload(const ResourceRequest&) { notImplementedGdk(); }
 void FrameLoaderClientGdk::updateGlobalHistoryForStandardLoad(const KURL&) { notImplementedGdk(); }
 void FrameLoaderClientGdk::updateGlobalHistoryForReload(const KURL&) { notImplementedGdk(); }
-bool FrameLoaderClientGdk::shouldGoToHistoryItem(HistoryItem*) const { notImplementedGdk(); return false;}
 
 }
index f784cf3..c7dc3f9 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
+
+        Reviewed by Brady Edison.
+
+        Add forward/backward/quit menus for easier testing.
+
+        * GdkLauncher/main.cpp:
+        (menuMainBackCb):
+        (menuMainForwardCb):
+        (menuMainQuitCb):
+        (main):
+
 2007-03-09  Andrew Wellington  <proton@wiretapped.net>
 
         Reviewed by Darin.
index 17f1359..348abbd 100644 (file)
@@ -93,6 +93,23 @@ static void frameDestroyCb(GtkWidget* widget, gpointer data)
     gtk_main_quit();
 }
 
+static void menuMainBackCb(gpointer data)
+{
+    ASSERT(!data);
+    gFrame->loader()->goBackOrForward(-1);
+}
+
+static void menuMainForwardCb(gpointer data)
+{
+    ASSERT(!data);
+    gFrame->loader()->goBackOrForward(1);
+}
+
+static void menuMainQuitCb(gpointer data)
+{
+    gtk_main_quit();
+}
+
 int main(int argc, char* argv[]) 
 {
     gtk_init(&argc, &argv);
@@ -120,6 +137,29 @@ int main(int argc, char* argv[])
             url = currArg;
     }
 
+    GtkWidget* menuMain = gtk_menu_new();
+    GtkWidget* menuMainBack = gtk_menu_item_new_with_label("Back");
+    gtk_menu_shell_append(GTK_MENU_SHELL(menuMain), menuMainBack);
+    g_signal_connect_swapped(G_OBJECT(menuMainBack), "activate", G_CALLBACK(menuMainBackCb), NULL);
+    gtk_widget_show(menuMainBack);
+
+    GtkWidget* menuMainForward = gtk_menu_item_new_with_label("Forward");
+    gtk_menu_shell_append(GTK_MENU_SHELL(menuMain), menuMainForward);
+    g_signal_connect_swapped(G_OBJECT(menuMainForward), "activate", G_CALLBACK(menuMainForwardCb), NULL);
+    gtk_widget_show(menuMainForward);
+
+    GtkWidget* menuMainQuit = gtk_menu_item_new_with_label("Quit");
+    gtk_menu_shell_append(GTK_MENU_SHELL(menuMain), menuMainQuit);
+    g_signal_connect_swapped(G_OBJECT(menuMainQuit), "activate", G_CALLBACK(menuMainQuitCb), NULL);
+    gtk_widget_show(menuMainQuit);
+
+    GtkWidget* menuMainRoot = gtk_menu_item_new_with_label("Main");
+    gtk_widget_show(menuMainRoot);
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuMainRoot), menuMain);
+
+    GtkWidget* menuBar = gtk_menu_bar_new();
+    gtk_menu_bar_append(GTK_MENU_BAR(menuBar), menuMainRoot);
+
     GtkWidget* topLevelWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_default_size(GTK_WINDOW(topLevelWindow), 800, 600);
     gtk_widget_set_name(topLevelWindow, "GdkLauncher");
@@ -129,6 +169,7 @@ int main(int argc, char* argv[])
     g_signal_connect(GTK_OBJECT(topLevelWindow), "size-request", G_CALLBACK(frameResizeCb), NULL);
 
     GtkWidget* hbox = gtk_hbox_new(FALSE, 2);
+    gtk_box_pack_start(GTK_BOX(vbox), menuBar, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
     gUrlBarEntry = gtk_entry_new();