aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyBrowser.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-19 03:40:08 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-19 03:40:08 +0800
commit0a389e07241775316dfb866341a1a3c9f6b8a441 (patch)
tree9d96af228f87def15b797f2f8ec5151bce6439c9 /embed/mozilla/EphyBrowser.cpp
parent29604a8fa8cf16a2b0e55ff6f8b9d10e57dd9be5 (diff)
downloadgsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.gz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.bz2
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.lz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.xz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.zst
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.zip
Disable Zoom items for images, and disable zoom, encoding and view source
2004-12-18 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed.c: (ephy_embed_chrome_get_type), (ephy_embed_document_type_get_type), (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_get_property), (ephy_tab_class_init), (ephy_tab_get_document_type), (ephy_tab_document_type_cb), (ephy_tab_init): * src/ephy-tab.h: * src/ephy-window.c: (sync_tab_document_type), (sync_tab_zoom), (ephy_window_set_active_tab): * src/toolbar.c: (toolbar_update_zoom): * src/toolbar.h: Disable Zoom items for images, and disable zoom, encoding and view source for images and xml (xul) documents. Fixes bug #132240.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r--embed/mozilla/EphyBrowser.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 8dffaa74d..2894b6e56 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -73,8 +73,11 @@
#include "nsIScriptSecurityManager.h"
#include "nsIServiceManager.h"
#include "nsIInterfaceRequestor.h"
+#include <nsIDOMHTMLDocument.h>
+#include <nsIDOMXMLDocument.h>
#ifdef ALLOW_PRIVATE_API
+#include <content/nsIImageDocument.h>
/* not frozen yet */
#include "nsIContentPolicy.h"
/* will never be frozen */
@@ -1129,3 +1132,33 @@ EphyBrowser::ShowCertificate ()
return NS_OK;
#endif
}
+
+EmbedDocumentType
+EphyBrowser::GetDocumentType ()
+{
+ EmbedDocumentType type = EMBED_DOCUMENT_OTHER;
+
+ nsresult rv;
+ nsCOMPtr<nsIDOMDocument> domDoc;
+ rv = GetDocument (getter_AddRefs (domDoc));
+ NS_ENSURE_SUCCESS (rv, type);
+
+ nsCOMPtr<nsIDOMHTMLDocument> htmlDoc (do_QueryInterface (domDoc));
+ nsCOMPtr<nsIDOMXMLDocument> xmlDoc (do_QueryInterface (domDoc));
+ nsCOMPtr<nsIImageDocument> imgDoc (do_QueryInterface (domDoc));
+
+ if (xmlDoc)
+ {
+ type = EMBED_DOCUMENT_XML;
+ }
+ else if (imgDoc)
+ {
+ type = EMBED_DOCUMENT_IMAGE;
+ }
+ else if (htmlDoc)
+ {
+ type = EMBED_DOCUMENT_HTML;
+ }
+
+ return type;
+}