Chromium Code Reviews| Index: chrome/renderer/extensions/app_window_custom_bindings.cc |
| diff --git a/chrome/renderer/extensions/app_window_custom_bindings.cc b/chrome/renderer/extensions/app_window_custom_bindings.cc |
| index 5ff47fc885cc3e5f4da95fb3341149384db68ffa..eb74aff807cb1b5f56bcc71aa4b92c1731c958a0 100644 |
| --- a/chrome/renderer/extensions/app_window_custom_bindings.cc |
| +++ b/chrome/renderer/extensions/app_window_custom_bindings.cc |
| @@ -59,6 +59,9 @@ AppWindowCustomBindings::AppWindowCustomBindings( |
| RouteFunction("OnContextReady", |
| base::Bind(&AppWindowCustomBindings::OnContextReady, |
| base::Unretained(this))); |
| + RouteFunction("OnCurrentContextReady", |
| + base::Bind(&AppWindowCustomBindings::OnCurrentContextReady, |
| + base::Unretained(this))); |
| } |
| namespace { |
| @@ -123,6 +126,31 @@ v8::Handle<v8::Value> AppWindowCustomBindings::OnContextReady( |
| return v8::True(); |
| } |
| +v8::Handle<v8::Value> AppWindowCustomBindings::OnCurrentContextReady( |
| + const v8::Arguments& args) { |
| + printf("+++ %s\n", __PRETTY_FUNCTION__); |
| + if (args.Length() != 1) |
| + return v8::Undefined(); |
| + |
| + if (!args[0]->IsFunction()) |
| + return v8::Undefined(); |
|
not at google - send to devlin
2013/06/13 22:08:32
just CHECK these, we call the method and it'd be a
lazyboy
2013/06/14 00:09:50
Done.
|
| + |
| + int routing_id = context()->GetRenderView()->GetRoutingID(); |
| + printf("found routing_id: %d\n", routing_id); |
| + |
| + //int view_id = args[0]->Int32Value(); |
| + int view_id = routing_id; |
| + |
| + content::RenderView* view = content::RenderView::FromRoutingID(view_id); |
|
not at google - send to devlin
2013/06/13 22:08:32
why go render view -> routing id -> render view he
lazyboy
2013/06/14 00:09:50
Ah I was quick hacking, fixed.
|
| + if (!view) |
| + return v8::Undefined(); |
| + |
| + v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(args[0]); |
| + new LoadWatcher(args.GetIsolate(), view, func); |
| + |
| + return v8::True(); |
|
not at google - send to devlin
2013/06/13 22:08:32
might as well return undefined
again I see that c
lazyboy
2013/06/14 00:09:50
Looks like the return value is used in
https://cod
|
| +} |
| + |
| v8::Handle<v8::Value> AppWindowCustomBindings::GetView( |
| const v8::Arguments& args) { |
| // TODO(jeremya): convert this to IDL nocompile to get validation, and turn |