diff --git a/browser.py b/browser.py
index ab972e7..7de97af 100644
|
a
|
b
|
|
| 15 | 15 | # along with this program; if not, write to the Free Software |
| 16 | 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | 17 | |
| | 18 | import os |
| | 19 | import time |
| 18 | 20 | import logging |
| 19 | 21 | from gettext import gettext as _ |
| 20 | 22 | |
| 21 | 23 | import gobject |
| 22 | | import os |
| 23 | | import time |
| | 24 | import gtk |
| 24 | 25 | import xpcom |
| 25 | 26 | from xpcom.nsError import * |
| 26 | 27 | from xpcom import components |
| … |
… |
|
| 65 | 66 | |
| 66 | 67 | def onSecurityChange(self, progress, request, state): |
| 67 | 68 | pass |
| 68 | | |
| | 69 | |
| 69 | 70 | class Browser(WebView): |
| 70 | 71 | |
| 71 | 72 | AGENT_SHEET = os.path.join(activity.get_bundle_path(), 'agent-stylesheet.css') |
| … |
… |
|
| 167 | 168 | if contentViewer is not None: |
| 168 | 169 | markupDocumentViewer = contentViewer.queryInterface(interfaces.nsIMarkupDocumentViewer) |
| 169 | 170 | markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT |
| | 171 | |
| | 172 | class XULDialog(gtk.Window): |
| | 173 | def __init__(self): |
| | 174 | gtk.Window.__init__(self) |
| | 175 | |
| | 176 | self.view = WebView() |
| | 177 | self.add(self.view) |
| | 178 | |
| | 179 | self.connect('realize', self.__realize_cb) |
| | 180 | |
| | 181 | def __realize_cb(self, window): |
| | 182 | self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) |
| | 183 | |
| | 184 | class WindowCreator: |
| | 185 | _com_interfaces_ = interfaces.nsIWindowCreator |
| | 186 | |
| | 187 | def createChromeWindow(self, parent, chrome_flags): |
| | 188 | dialog = XULDialog() |
| | 189 | browser = dialog.view.browser |
| | 190 | |
| | 191 | dialog.view.is_chrome = True |
| | 192 | item = browser.queryInterface(interfaces.nsIDocShellTreeItem) |
| | 193 | item.itemType = interfaces.nsIDocShellTreeItem.typeChromeWrapper |
| | 194 | |
| | 195 | return browser.containerWindow |
| | 196 | |
| | 197 | window_creator = WindowCreator() |
| | 198 | cls = components.classes['@mozilla.org/embedcomp/window-watcher;1'] |
| | 199 | window_watcher = cls.getService(interfaces.nsIWindowWatcher) |
| | 200 | window_watcher.setWindowCreator(window_creator) |