1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/embed/ephy-embed.c epiphany-2.16.1/embed/ephy-embed.c
--- epiphany-2.16.1.orig/embed/ephy-embed.c 2006-09-13 07:48:29.000000000 -0400
+++ epiphany-2.16.1/embed/ephy-embed.c 2006-11-17 11:17:32.000000000 -0500
@@ -423,6 +423,25 @@ ephy_embed_load_url (EphyEmbed *embed,
}
/**
+ * ephy_embed_load:
+ * @embed: an #EphyEmbed
+ * @url: an URL
+ * @flags: flags modifying load behaviour
+ * @previous_embed: the referrer embed or %NULL
+ *
+ * Loads a new web page in @embed.
+ **/
+void
+ephy_embed_load (EphyEmbed *embed,
+ const char *url,
+ EphyEmbedLoadFlags flags,
+ EphyEmbed *referring_embed)
+{
+ EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
+ iface->load (embed, url, flags, referring_embed);
+}
+
+/**
* ephy_embed_stop_load:
* @embed: an #EphyEmbed
*
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/embed/ephy-embed.h epiphany-2.16.1/embed/ephy-embed.h
--- epiphany-2.16.1.orig/embed/ephy-embed.h 2006-09-13 07:48:29.000000000 -0400
+++ epiphany-2.16.1/embed/ephy-embed.h 2006-11-17 11:17:32.000000000 -0500
@@ -63,6 +63,12 @@ typedef enum
EPHY_EMBED_CHROME_BOOKMARKSBAR = 1 << 3
} EphyEmbedChrome;
+typedef enum
+{
+ EPHY_EMBED_LOAD_FLAGS_NONE = 1 << 0,
+ EPHY_EMBED_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 1 << 1,
+} EphyEmbedLoadFlags;
+
#define EPHY_EMBED_CHROME_ALL (EPHY_EMBED_CHROME_MENUBAR | \
EPHY_EMBED_CHROME_TOOLBAR | \
EPHY_EMBED_CHROME_STATUSBAR | \
@@ -157,6 +163,10 @@ struct _EphyEmbedIface
/* Methods */
void (* load_url) (EphyEmbed *embed,
const char *url);
+ void (* load) (EphyEmbed *embed,
+ const char *url,
+ EphyEmbedLoadFlags flags,
+ EphyEmbed *referring_embed);
void (* stop_load) (EphyEmbed *embed);
void (* reload) (EphyEmbed *embed,
gboolean force);
@@ -232,6 +242,10 @@ GType ephy_embed_get_type (void);
/* Base */
void ephy_embed_load_url (EphyEmbed *embed,
const char *url);
+void ephy_embed_load (EphyEmbed *embed,
+ const char *url,
+ EphyEmbedLoadFlags flags,
+ EphyEmbed *referring_embed);
void ephy_embed_stop_load (EphyEmbed *embed);
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/embed/mozilla/EphyBrowser.cpp epiphany-2.16.1/embed/mozilla/EphyBrowser.cpp
--- epiphany-2.16.1.orig/embed/mozilla/EphyBrowser.cpp 2006-09-13 07:48:34.000000000 -0400
+++ epiphany-2.16.1/embed/mozilla/EphyBrowser.cpp 2006-11-17 11:17:32.000000000 -0500
@@ -1524,3 +1524,55 @@ EphyBrowser::Close ()
return domWin->Close();
}
+
+nsresult
+EphyBrowser::GetPIDOMWindow(nsPIDOMWindow **aPIWin)
+{
+ *aPIWin = nsnull;
+
+ // get the private DOM window
+ nsCOMPtr<nsPIDOMWindow> domWindowPrivate = do_QueryInterface(mDOMWindow);
+
+ // and the root window for that DOM window
+ *aPIWin = domWindowPrivate->GetPrivateRoot();
+
+ if (*aPIWin)
+ {
+ NS_ADDREF(*aPIWin);
+ return NS_OK;
+ }
+
+ return NS_ERROR_FAILURE;
+
+}
+
+nsresult
+EphyBrowser::LoadURI(const char *aURI,
+ PRUint32 aLoadFlags,
+ nsIURI *aReferrer)
+{
+ nsString uURI;
+ nsresult rv = NS_OK;
+
+ NS_CStringToUTF16 (nsCString (aURI), NS_CSTRING_ENCODING_UTF8, uURI);
+
+ if (uURI.Length() == 0) return NS_OK;
+
+ nsCOMPtr<nsIWebNavigation> contentNav = do_QueryInterface (mWebBrowser);
+ NS_ENSURE_TRUE (contentNav, NS_ERROR_FAILURE);
+
+ nsCOMPtr<nsPIDOMWindow> piWin;
+ rv = GetPIDOMWindow(getter_AddRefs(piWin));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsAutoPopupStatePusher popupStatePusher(piWin, openAllowed);
+
+ rv = contentNav->LoadURI(uURI.get(), // URI string
+ aLoadFlags, // Load flags
+ aReferrer, // Referring URI
+ nsnull, // Post data
+ nsnull); // extra headers
+
+ return rv;
+}
+
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/embed/mozilla/EphyBrowser.h epiphany-2.16.1/embed/mozilla/EphyBrowser.h
--- epiphany-2.16.1.orig/embed/mozilla/EphyBrowser.h 2006-09-13 07:48:35.000000000 -0400
+++ epiphany-2.16.1/embed/mozilla/EphyBrowser.h 2006-11-17 11:17:32.000000000 -0500
@@ -36,6 +36,7 @@
#include <nsIWebBrowserFocus.h>
#include <nsIWebBrowser.h>
#include <nsIWebNavigation.h>
+#include <nsPIDOMWindow.h>
#ifdef ALLOW_PRIVATE_API
#include <nsIContentViewer.h>
@@ -172,6 +173,7 @@ public:
nsresult GetDocumentURI (nsIURI **aURI);
nsresult GetTargetDocumentURI (nsIURI **aURI);
nsresult GetDOMWindow (nsIDOMWindow **window);
+ nsresult GetPIDOMWindow(nsPIDOMWindow **aPIWin);
nsresult GetHasModifiedForms (PRBool *modified);
@@ -183,6 +185,10 @@ public:
nsresult Close ();
+ nsresult LoadURI(const char *aURI,
+ PRUint32 aLoadFlags = nsIWebNavigation::LOAD_FLAGS_NONE,
+ nsIURI *aURI = nsnull);
+
EphyEmbedDocumentType GetDocumentType ();
nsCOMPtr<nsIWebBrowser> mWebBrowser;
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/embed/mozilla/mozilla-embed.cpp epiphany-2.16.1/embed/mozilla/mozilla-embed.cpp
--- epiphany-2.16.1.orig/embed/mozilla/mozilla-embed.cpp 2006-09-13 07:48:39.000000000 -0400
+++ epiphany-2.16.1/embed/mozilla/mozilla-embed.cpp 2006-11-17 11:18:04.000000000 -0500
@@ -324,6 +324,42 @@ impl_load_url (EphyEmbed *embed,
gtk_moz_embed_load_url (GTK_MOZ_EMBED(embed), url);
}
+static char * impl_get_location (EphyEmbed *embed, gboolean toplevel);
+
+static void
+impl_load (EphyEmbed *embed,
+ const char *url,
+ EphyEmbedLoadFlags flags,
+ EphyEmbed *preview_embed)
+{
+ EphyBrowser *browser;
+
+ browser = MOZILLA_EMBED(embed)->priv->browser;
+ g_return_if_fail (browser != NULL);
+
+ nsCOMPtr<nsIURI> uri;
+ if (preview_embed != NULL)
+ {
+ EphyBrowser *pbrowser;
+
+ pbrowser = MOZILLA_EMBED(preview_embed)->priv->browser;
+ if (pbrowser != NULL)
+ {
+ pbrowser->GetDocumentURI (getter_AddRefs (uri));
+ }
+ }
+#ifdef HAVE_GECKO_1_8_1
+ if (flags & EPHY_EMBED_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP)
+ {
+ browser->LoadURI (url, nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP, uri);
+ }
+ else
+#endif /* HAVE_GECKO_1_8_1 */
+ {
+ browser->LoadURI (url, nsIWebNavigation::LOAD_FLAGS_NONE, uri);
+ }
+}
+
static void
impl_stop_load (EphyEmbed *embed)
{
@@ -1114,6 +1150,7 @@ static void
ephy_embed_iface_init (EphyEmbedIface *iface)
{
iface->load_url = impl_load_url;
+ iface->load = impl_load;
iface->stop_load = impl_stop_load;
iface->can_go_back = impl_can_go_back;
iface->can_go_forward =impl_can_go_forward;
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/src/ephy-link.h epiphany-2.16.1/src/ephy-link.h
--- epiphany-2.16.1.orig/src/ephy-link.h 2006-09-13 07:48:52.000000000 -0400
+++ epiphany-2.16.1/src/ephy-link.h 2006-11-17 11:17:32.000000000 -0500
@@ -41,7 +41,8 @@ typedef enum
{
EPHY_LINK_NEW_WINDOW = 1 << 0,
EPHY_LINK_NEW_TAB = 1 << 1,
- EPHY_LINK_JUMP_TO = 1 << 2
+ EPHY_LINK_JUMP_TO = 1 << 2,
+ EPHY_LINK_ALLOW_FIXUP = 1 << 3
} EphyLinkFlags;
struct _EphyLinkIface
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/src/ephy-location-action.c epiphany-2.16.1/src/ephy-location-action.c
--- epiphany-2.16.1.orig/src/ephy-location-action.c 2006-09-13 07:48:52.000000000 -0400
+++ epiphany-2.16.1/src/ephy-location-action.c 2006-11-17 11:17:32.000000000 -0500
@@ -139,7 +139,7 @@ action_activated_cb (GtkEntryCompletion
if (url == NULL) return;
ephy_link_open (EPHY_LINK (action), url, NULL,
- ephy_link_flags_from_current_event ());
+ ephy_link_flags_from_current_event () | EPHY_LINK_ALLOW_FIXUP);
g_free (url);
}
@@ -162,7 +162,7 @@ entry_activate_cb (GtkEntry *entry,
g_return_if_fail (address != NULL);
ephy_link_open (EPHY_LINK (action), address, NULL,
- ephy_link_flags_from_current_event ());
+ ephy_link_flags_from_current_event () | EPHY_LINK_ALLOW_FIXUP);
g_free (address);
}
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/src/ephy-shell.c epiphany-2.16.1/src/ephy-shell.c
--- epiphany-2.16.1.orig/src/ephy-shell.c 2006-09-13 07:48:52.000000000 -0400
+++ epiphany-2.16.1/src/ephy-shell.c 2006-11-17 11:17:32.000000000 -0500
@@ -530,8 +530,20 @@ ephy_shell_new_tab_full (EphyShell *shel
}
else if (flags & EPHY_NEW_TAB_OPEN_PAGE)
{
+ EphyEmbedLoadFlags load_flags = 0;
+
g_assert (url != NULL);
- ephy_embed_load_url (embed, url);
+
+ if (flags & EPHY_NEW_TAB_ALLOW_FIXUP)
+ {
+ load_flags = EPHY_EMBED_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
+ }
+ else
+ {
+ load_flags = EPHY_EMBED_LOAD_FLAGS_NONE;
+ }
+ ephy_embed_load (embed, url, load_flags, previous_embed);
+
is_empty = url_is_empty (url);
}
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/src/ephy-shell.h epiphany-2.16.1/src/ephy-shell.h
--- epiphany-2.16.1.orig/src/ephy-shell.h 2006-09-13 07:48:53.000000000 -0400
+++ epiphany-2.16.1/src/ephy-shell.h 2006-11-17 11:17:32.000000000 -0500
@@ -62,6 +62,10 @@ typedef enum
EPHY_NEW_TAB_JUMP = 1 << 9,
EPHY_NEW_TAB_IN_NEW_WINDOW = 1 << 10,
EPHY_NEW_TAB_IN_EXISTING_WINDOW = 1 << 11,
+
+ /* The way to load */
+ EPHY_NEW_TAB_ALLOW_FIXUP = 1 << 12,
+
} EphyNewTabFlags;
struct _EphyShell
diff --exclude-from=/home/dang/.diffrc -up -ruN epiphany-2.16.1.orig/src/ephy-window.c epiphany-2.16.1/src/ephy-window.c
--- epiphany-2.16.1.orig/src/ephy-window.c 2006-09-13 07:48:53.000000000 -0400
+++ epiphany-2.16.1/src/ephy-window.c 2006-11-17 11:17:32.000000000 -0500
@@ -2976,7 +2976,9 @@ ephy_window_open_link (EphyLink *link,
tab = ephy_window_get_active_tab (window);
}
- if (flags != 0)
+ if (flags & (EPHY_LINK_JUMP_TO |
+ EPHY_LINK_NEW_TAB |
+ EPHY_LINK_NEW_WINDOW))
{
EphyNewTabFlags ntflags = EPHY_NEW_TAB_OPEN_PAGE;
@@ -2993,6 +2995,10 @@ ephy_window_open_link (EphyLink *link,
{
ntflags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW;
}
+ if (flags & EPHY_LINK_ALLOW_FIXUP)
+ {
+ ntflags |= EPHY_NEW_TAB_ALLOW_FIXUP;
+ }
new_tab = ephy_shell_new_tab
(ephy_shell,
@@ -3005,7 +3011,17 @@ ephy_window_open_link (EphyLink *link,
embed = ephy_tab_get_embed (tab);
+ if (flags & EPHY_LINK_ALLOW_FIXUP)
+ {
+ ephy_embed_load (embed,
+ address,
+ EPHY_EMBED_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP,
+ NULL);
+ }
+ else
+ {
ephy_embed_load_url (embed, address);
+ }
if (address == NULL || address[0] == '\0' || strcmp (address, "about:blank") == 0)
{
|