Index: chrome/test/pyautolib/pyautolib.i |
=================================================================== |
--- chrome/test/pyautolib/pyautolib.i (revision 124976) |
+++ 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> |
@@ -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" |
Nirnimesh
2012/03/05 19:46:01
Do you still get a compilation error if you add ju
dyu1
2012/03/06 20:45:14
No, it worked fine. The compile errors were relate
|
+%include "content/public/common/security_style.h" |
+%include "net/base/net_export.h" |
+%include "net/base/cert_status_flags.h" |
%{ |
#include "chrome/common/automation_constants.h" |
@@ -147,6 +153,39 @@ |
"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() { |
Nirnimesh
2012/03/05 19:46:01
This should be aligned at regular indent level, no
dyu1
2012/03/06 20:45:14
Done.
|
+ content::SecurityStyle security_style; |
+ net::CertStatus ssl_cert_status; |
+ int insecure_content_status; |
+ bool success = $self->GetSecurityState(&security_style, |
+ &ssl_cert_status, &insecure_content_status); |
+ PyObject* result_dict = PyDict_New(); |
+ 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)); |
+ PyObject* tpl = PyTuple_New(2); |
+ PyTuple_SetItem(tpl, 0, PyBool_FromLong(success)); |
+ PyTuple_SetItem(tpl, 1, result_dict); |
+ return tpl; |
Nirnimesh
2012/03/05 19:46:01
I don't like the idea of returning a tuple. Why no
dyu1
2012/03/06 20:45:14
Done.
|
+ } |
+ } |
+ %extend { |
+ %feature("docstring", |
+ "Returns the type of page currently showing " |
+ "(normal, interstitial, error.") GetPageType; |
+ bool GetPageType(int* OUTPUT) { |
Nirnimesh
2012/03/05 19:46:01
This should be aligned at regular indent level, no
dyu1
2012/03/06 20:45:14
Done.
|
+ return $self->GetPageType(reinterpret_cast<content::PageType*>(OUTPUT)); |
Nirnimesh
2012/03/05 19:46:01
80+ chars
Nirnimesh
2012/03/05 19:46:01
To get rid of pointers in python, why not implemen
dyu1
2012/03/06 20:45:14
Done.
dyu1
2012/03/06 20:45:14
Done.
|
+ } |
+ } |
// HTTP Auth |
%feature("docstring", |
@@ -475,3 +514,6 @@ |
%{ |
typedef net::TestServer::HTTPSOptions HTTPSOptions; |
%} |
+ |
+%pointer_class(int, int_ptr); |
+%pointer_class(uint32, uint32_ptr); |