| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/renderer/extension_helper.h" | 5 #include "extensions/renderer/extension_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ExtensionHelper::OnAppWindowClosed() { | 68 void ExtensionHelper::OnAppWindowClosed() { |
| 69 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 69 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 70 v8::Local<v8::Context> v8_context = | 70 v8::Local<v8::Context> v8_context = |
| 71 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 71 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
| 72 ScriptContext* script_context = | 72 ScriptContext* script_context = |
| 73 dispatcher_->script_context_set().GetByV8Context(v8_context); | 73 dispatcher_->script_context_set().GetByV8Context(v8_context); |
| 74 if (!script_context) | 74 if (!script_context) |
| 75 return; | 75 return; |
| 76 script_context->module_system()->CallModuleMethod("app.window", | 76 script_context->module_system()->CallModuleMethodSafe("app.window", |
| 77 "onAppWindowClosed"); | 77 "onAppWindowClosed"); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace extensions | 80 } // namespace extensions |
| OLD | NEW |