Chromium Code Reviews| Index: chrome/test/pyautolib/pyautolib.i |
| =================================================================== |
| --- chrome/test/pyautolib/pyautolib.i (revision 126691) |
| +++ chrome/test/pyautolib/pyautolib.i (working copy) |
| @@ -17,8 +17,10 @@ |
| %module(docstring="Python interface to Automation Proxy.") pyautolib |
| %feature("autodoc", "1"); |
| +%include <cpointer.i> |
| %include <std_wstring.i> |
| %include <std_string.i> |
|
dennis_jeffrey
2012/03/14 21:55:27
nit: swap above 2 lines for alphabetical order (as
dyu1
2012/03/14 22:32:32
Done.
|
| +%include <typemaps.i> |
| %include "chrome/test/pyautolib/argc_argv.i" |
| @@ -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/14 21:55:27
If order is important here, maybe we should have a
dyu1
2012/03/14 22:32:32
Done.
|
| %{ |
| #include "chrome/common/automation_constants.h" |
| @@ -147,6 +153,42 @@ |
| "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; |
| + PyObject* result_dict = PyDict_New(); |
| + if ($self->GetSecurityState( |
| + &security_style, &ssl_cert_status, &insecure_content_status)) { |
| + 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"), |
| + PyInt_FromLong(insecure_content_status)); |
|
dennis_jeffrey
2012/03/14 21:55:27
recommend this indentation:
PyDict_SetItem(result
dyu1
2012/03/14 22:32:32
Done.
|
| + } |
| + return result_dict; |
| + } |
| + }; |
| + %extend { |
| + %feature("docstring", "Returns the type of page currently showing " |
| + "(normal, interstitial, error.") |
| + GetPageType; |
| + PyObject* GetPageType(){ |
|
dennis_jeffrey
2012/03/14 21:55:27
add a space before the {
dyu1
2012/03/14 22:32:32
Done.
|
| + content::PageType page_type; |
| + PyObject* result_dict = PyDict_New(); |
| + if ($self->GetPageType(&page_type)) { |
| + PyDict_SetItem(result_dict, PyString_FromString("page_type"), |
| + PyInt_FromLong(page_type)); |
| + } |
| + return result_dict; |
| + } |
| + }; |
| // HTTP Auth |
| %feature("docstring", |
| @@ -475,3 +517,6 @@ |
| %{ |
| typedef net::TestServer::HTTPSOptions HTTPSOptions; |
| %} |
| + |
| +%pointer_class(int, int_ptr); |
| +%pointer_class(uint32, uint32_ptr); |