Ticket #4245: 0001-Display-security-as-a-lock-broken-lock-icon-for-secu.patch
File 0001-Display-security-as-a-lock-broken-lock-icon-for-secu.patch, 8.6 KB (added by manuq, 11 years ago) |
---|
-
new file icons/channel-insecure-symbolic.svg
From f5b4b5e2581321ee5aa9112fd11937cc5ef411e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org> Date: Wed, 28 Nov 2012 11:53:59 -0300 Subject: [PATCH browse] Display security as a lock / broken lock icon for secured (https) pages - SL #4245 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mail-Followup-To: <sugar-devel@lists.sugarlabs.org> Signed-off-by: Manuel Quiñones <manuq@laptop.org> --- icons/channel-insecure-symbolic.svg | 59 ++++++++++++++++++++++++++++++++++++ icons/channel-secure-symbolic.svg | 60 +++++++++++++++++++++++++++++++++++++ webactivity.py | 2 ++ webtoolbar.py | 29 +++++++++++++++++- 4 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 icons/channel-insecure-symbolic.svg create mode 100644 icons/channel-secure-symbolic.svg diff --git a/icons/channel-insecure-symbolic.svg b/icons/channel-insecure-symbolic.svg new file mode 100644 index 0000000..4c6ee0b
- + 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ 3 <!ENTITY fill_color "#FFFFFF"> 4 <!ENTITY stroke_color "#010101"> 5 ]> 6 7 <svg 8 xmlns="http://www.w3.org/2000/svg" 9 version="1.1" 10 width="22.16" 11 height="22.16" 12 id="svg7384"> 13 <title 14 id="title9167">Gnome Symbolic Icon Theme</title> 15 <g 16 transform="translate(-101.0002,-390.84)" 17 id="layer9" 18 style="display:inline"> 19 <g 20 transform="translate(81.0002,121)" 21 id="g4053-3-8" 22 style="fill:#bebebe;fill-opacity:1" /> 23 <g 24 transform="matrix(1.3,0,0,1.3,-30.225691,-123.93)" 25 id="g4347"> 26 <path 27 d="m 106.0002,397 c -1.64469,0 -3,1.35529 -3,3 l 0,3 2,0 0,-3 c 0,-0.57129 0.42873,-1 1,-1 l 2,0 c 0.57127,0 1,0.42871 1,1 l 0,0.25 c 0.26687,-0.14912 0.55674,-0.25 0.875,-0.25 l 1.125,0 c 0,-1.64471 -1.35531,-3 -3,-3 z m -3.0625,9 c -0.554,0 -1.06473,0.44979 -1,1 l 0,0.53125 0,4.46875 10.0625,0 0,-2 -2.125,0 c -1.01035,0 -1.875,-0.86466 -1.875,-1.875 l 0,-2.125 z" 28 id="rect4063-6-6" 29 style="color:#bebebe;fill:&stroke_color;;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible" /> 30 <path 31 d="m 109.875,401 c -0.49245,0 -0.875,0.38256 -0.875,0.875 l 0,6.25 c 0,0.49244 0.38255,0.875 0.875,0.875 l 6.25,0 c 0.49245,0 0.875,-0.38256 0.875,-0.875 l 0,-6.25 C 117,401.38256 116.61745,401 116.125,401 z m 2.50204,1 1.24592,0 0,4 -1.24592,0 z m 0,5 1.24592,0 0,1 -1.24592,0 z" 32 id="path10898-3-1" 33 style="color:#bebebe;fill:&stroke_color;;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible" /> 34 </g> 35 </g> 36 <g 37 transform="translate(-101.0002,-390.84)" 38 id="layer10" /> 39 <g 40 transform="translate(-101.0002,-390.84)" 41 id="layer11" /> 42 <g 43 transform="translate(-101.0002,-390.84)" 44 id="layer12" /> 45 <g 46 transform="translate(-101.0002,-390.84)" 47 id="layer13" /> 48 <g 49 transform="translate(-101.0002,-390.84)" 50 id="layer14" /> 51 <g 52 transform="translate(-101.0002,-390.84)" 53 id="layer15" 54 style="display:inline" /> 55 <g 56 transform="translate(-101.0002,-390.84)" 57 id="g4953" 58 style="display:inline" /> 59 </svg> -
new file icons/channel-secure-symbolic.svg
diff --git a/icons/channel-secure-symbolic.svg b/icons/channel-secure-symbolic.svg new file mode 100644 index 0000000..8405550
- + 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ 3 <!ENTITY fill_color "#FFFFFF"> 4 <!ENTITY stroke_color "#010101"> 5 ]> 6 7 <svg 8 xmlns="http://www.w3.org/2000/svg" 9 version="1.1" 10 width="22.16" 11 height="22.16" 12 id="svg7384"> 13 <title 14 id="title9167">Gnome Symbolic Icon Theme</title> 15 <g 16 transform="translate(-81.0002,-390.84)" 17 id="layer9" 18 style="display:inline"> 19 <g 20 transform="matrix(1.3,0,0,1.3,-23.597904,-123.93)" 21 id="g3526"> 22 <g 23 transform="translate(61.0002,121)" 24 id="g4053-1-5" 25 style="fill:#bebebe;fill-opacity:1" /> 26 <path 27 d="m 85.0002,404 c -0.554,0 -1.18921,0.47931 -1,1 l 0,0.53125 0,4.46875 10,0 0,-4.46875 0,-0.53125 c 0,-0.554 -0.446,-1 -1,-1 z" 28 id="rect4063-8-6" 29 style="color:#bebebe;fill:&stroke_color;;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible" /> 30 <path 31 d="m 88,399 c -1.644703,0 -3,1.3553 -3,3 l 0,4 c 0,1.6447 1.355297,3 3,3 l 2,0 c 1.644703,0 3,-1.3553 3,-3 l 0,-4 c 0,-1.6447 -1.355297,-3 -3,-3 l -2,0 z m 0,2 2,0 c 0.571297,0 1,0.4287 1,1 l 0,4 c 0,0.5713 -0.428703,1 -1,1 l -2,0 c -0.571297,0 -1,-0.4287 -1,-1 l 0,-4 c 0,-0.5713 0.428703,-1 1,-1 z" 32 id="rect4291-5-4" 33 style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#bebebe;fill:&stroke_color;;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /> 34 </g> 35 </g> 36 <g 37 transform="translate(-81.0002,-390.84)" 38 id="layer10" /> 39 <g 40 transform="translate(-81.0002,-390.84)" 41 id="layer11" /> 42 <g 43 transform="translate(-81.0002,-390.84)" 44 id="layer12" 45 style="display:inline" /> 46 <g 47 transform="translate(-81.0002,-390.84)" 48 id="layer13" /> 49 <g 50 transform="translate(-81.0002,-390.84)" 51 id="layer14" /> 52 <g 53 transform="translate(-81.0002,-390.84)" 54 id="layer15" 55 style="display:inline" /> 56 <g 57 transform="translate(-81.0002,-390.84)" 58 id="g4953" 59 style="display:inline" /> 60 </svg> -
webactivity.py
diff --git a/webactivity.py b/webactivity.py index 0e3b61b..3c0d337 100644
a b class WebActivity(activity.Activity): 156 156 157 157 session = WebKit.get_default_session() 158 158 session.set_property('accept-language-auto', True) 159 session.set_property('ssl-use-system-ca-file', True) 160 session.set_property('ssl-strict', False) 159 161 160 162 # By default, cookies are not stored persistently, we have to 161 163 # add a cookie jar so that they get saved to disk. We use one -
webtoolbar.py
diff --git a/webtoolbar.py b/webtoolbar.py index 642b310..ae20deb 100644
a b 17 17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 18 19 19 from gettext import gettext as _ 20 import logging 20 21 21 22 from gi.repository import GObject 22 23 from gi.repository import Gtk … … class PrimaryToolbar(ToolbarBase): 378 379 self._update_navigation_buttons() 379 380 380 381 def __loading_changed_cb(self, widget, param): 381 self._set_status(widget.get_load_status()) 382 status = widget.get_load_status() 383 self._set_status(status) 384 if status == WebKit.LoadStatus.COMMITTED: 385 # Display security status as a lock icon in left side of 386 # the URL entry: 387 icon_name = None 388 response = widget.get_main_frame().get_network_response() 389 message = response.get_message() 390 if message: 391 use_https, certificate, tls_errors = message.get_https_status() 392 393 logging.debug("TEST get_uri %r", widget.get_uri()) 394 logging.debug("TEST get_https_status %r %r %r", use_https, certificate, tls_errors) 395 logging.debug("TEST tls_errors %r", tls_errors == 0) 396 397 if use_https: 398 if tls_errors == 0: 399 icon_name = 'channel-secure-symbolic' 400 else: 401 icon_name = 'channel-insecure-symbolic' 402 403 if icon_name is None: 404 self.entry.set_icon_from_pixbuf( 405 iconentry.ICON_ENTRY_PRIMARY, None) 406 else: 407 self.entry.set_icon_from_name( 408 iconentry.ICON_ENTRY_PRIMARY, icon_name) 382 409 383 410 def __progress_changed_cb(self, widget, param): 384 411 self._set_progress(widget.get_progress())