| 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 "content/public/renderer/render_view.h" | 7 #include "content/public/renderer/render_view.h" |
| 8 #include "content/public/renderer/render_view_visitor.h" | 8 #include "content/public/renderer/render_view_visitor.h" |
| 9 #include "extensions/common/constants.h" | 9 #include "extensions/common/constants.h" |
| 10 #include "extensions/common/extension_messages.h" | 10 #include "extensions/common/extension_messages.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 browser_window_id_ = window_id; | 215 browser_window_id_ = window_id; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void ExtensionHelper::OnAddMessageToConsole(ConsoleMessageLevel level, | 218 void ExtensionHelper::OnAddMessageToConsole(ConsoleMessageLevel level, |
| 219 const std::string& message) { | 219 const std::string& message) { |
| 220 console::AddMessage(render_view(), level, message); | 220 console::AddMessage(render_view(), level, message); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void ExtensionHelper::OnAppWindowClosed() { | 223 void ExtensionHelper::OnAppWindowClosed() { |
| 224 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 224 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 225 v8::Handle<v8::Context> v8_context = | 225 v8::Local<v8::Context> v8_context = |
| 226 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 226 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
| 227 ScriptContext* script_context = | 227 ScriptContext* script_context = |
| 228 dispatcher_->script_context_set().GetByV8Context(v8_context); | 228 dispatcher_->script_context_set().GetByV8Context(v8_context); |
| 229 if (!script_context) | 229 if (!script_context) |
| 230 return; | 230 return; |
| 231 script_context->module_system()->CallModuleMethod("app.window", | 231 script_context->module_system()->CallModuleMethod("app.window", |
| 232 "onAppWindowClosed"); | 232 "onAppWindowClosed"); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace extensions | 235 } // namespace extensions |
| OLD | NEW |