Index: chrome/test/pyautolib/pyautolib.i |
=================================================================== |
--- chrome/test/pyautolib/pyautolib.i (revision 125210) |
+++ chrome/test/pyautolib/pyautolib.i (working copy) |
@@ -17,6 +17,8 @@ |
%module(docstring="Python interface to Automation Proxy.") pyautolib |
%feature("autodoc", "1"); |
+%include <typemaps.i> |
+%include <cpointer.i> |
%include <std_wstring.i> |
%include <std_string.i> |
dennis_jeffrey
2012/03/09 02:07:47
nit: put the above 4 lines in alphabetical order
dyu1
2012/03/14 19:00:10
Done.
|
@@ -30,6 +32,10 @@ |
%include "chrome/app/chrome_dll_resource.h" |
%include "chrome/common/automation_constants.h" |
%include "chrome/common/pref_names.h" |
+%include "content/public/common/page_type.h" |
+%include "content/public/common/security_style.h" |
+%include "net/base/net_export.h" |
+%include "net/base/cert_status_flags.h" |
dennis_jeffrey
2012/03/09 02:07:47
nit: swap the above 2 lines to maintain alphabetic
dyu1
2012/03/14 19:00:10
The ordering is correct. If I swap it there will b
|
%{ |
#include "chrome/common/automation_constants.h" |
@@ -147,6 +153,43 @@ |
"button, if false to 'Take me out of there' button.") |
TakeActionOnSSLBlockingPage; |
bool TakeActionOnSSLBlockingPage(bool proceed); |
+ %extend { |
+ %feature("docstring", "Retrieves the different security states for the " |
+ "current tab.") |
+ GetSecurityState; |
+ PyObject* GetSecurityState() { |
+ content::SecurityStyle security_style; |
+ net::CertStatus ssl_cert_status; |
+ int insecure_content_status; |
+ if ($self->GetSecurityState( |
+ &security_style, &ssl_cert_status, &insecure_content_status)){ |
dennis_jeffrey
2012/03/09 02:07:47
add a space before the {
dyu1
2012/03/14 19:00:10
Done.
|
+ PyObject* result_dict = PyDict_New(); |
dennis_jeffrey
2012/03/09 02:07:47
move this definition above the loop, then remove l
dyu1
2012/03/14 19:00:10
Done.
|
+ PyDict_SetItem(result_dict, PyString_FromString("security_style"), |
+ PyInt_FromLong(security_style)); |
+ PyDict_SetItem(result_dict, PyString_FromString("ssl_cert_status"), |
+ PyInt_FromLong(ssl_cert_status)); |
+ PyDict_SetItem(result_dict, PyString_FromString("insecure_content_status"), |
dennis_jeffrey
2012/03/09 02:07:47
make sure this line doesn't exceed 80 chars
dyu1
2012/03/14 19:00:10
Done.
|
+ PyInt_FromLong(insecure_content_status)); |
dennis_jeffrey
2012/03/09 02:07:47
Indent lines 167 - 172 by 2 more spaces each
dyu1
2012/03/14 19:00:10
Done.
|
+ return result_dict; |
+ } |
+ return PyDict_New(); |
+ } |
+ }; |
+ %extend { |
+ %feature("docstring", "Returns the type of page currently showing " |
+ "(normal, interstitial, error.") |
+ GetPageType; |
+ PyObject* GetPageType(){ |
+ content::PageType page_type; |
+ if ($self->GetPageType(&page_type)){ |
dennis_jeffrey
2012/03/09 02:07:47
add a space before the {
dyu1
2012/03/14 19:00:10
Done.
|
+ PyObject* result_dict = PyDict_New(); |
dennis_jeffrey
2012/03/09 02:07:47
move this line to above the loop, then remove line
dyu1
2012/03/14 19:00:10
Done.
|
+ PyDict_SetItem(result_dict, PyString_FromString("page_type"), |
dennis_jeffrey
2012/03/09 02:07:47
indent this line by 2 more spaces
dyu1
2012/03/14 19:00:10
Done.
|
+ PyInt_FromLong(page_type)); |
dennis_jeffrey
2012/03/09 02:07:47
indent this further to line up underneath the firs
dyu1
2012/03/14 19:00:10
Done.
|
+ return result_dict; |
+ } |
+ return PyDict_New(); |
+ } |
+ }; |
// HTTP Auth |
%feature("docstring", |
@@ -475,3 +518,6 @@ |
%{ |
typedef net::TestServer::HTTPSOptions HTTPSOptions; |
%} |
+ |
+%pointer_class(int, int_ptr); |
+%pointer_class(uint32, uint32_ptr); |