OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/app_bindings.h" | 5 #include "chrome/renderer/extensions/app_bindings.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 OnAppInstallStateResponse) | 193 OnAppInstallStateResponse) |
194 IPC_MESSAGE_UNHANDLED(CHECK(false) << "Unhandled IPC message") | 194 IPC_MESSAGE_UNHANDLED(CHECK(false) << "Unhandled IPC message") |
195 IPC_END_MESSAGE_MAP() | 195 IPC_END_MESSAGE_MAP() |
196 return true; | 196 return true; |
197 } | 197 } |
198 | 198 |
199 void AppBindings::OnAppInstallStateResponse( | 199 void AppBindings::OnAppInstallStateResponse( |
200 const std::string& state, int callback_id) { | 200 const std::string& state, int callback_id) { |
201 v8::HandleScope handle_scope; | 201 v8::HandleScope handle_scope; |
202 v8::Context::Scope context_scope(context_->v8_context()); | 202 v8::Context::Scope context_scope(context_->v8_context()); |
203 v8::Handle<v8::Value> argv[2]; | 203 v8::Handle<v8::Value> argv[] = { |
204 argv[0] = v8::String::New(state.c_str()); | 204 v8::String::New(state.c_str()), |
205 argv[1] = v8::Integer::New(callback_id); | 205 v8::Integer::New(callback_id) |
206 CHECK(context_->CallChromeHiddenMethod("app.onInstallStateResponse", | 206 }; |
207 arraysize(argv), argv, NULL)); | 207 context_->module_system()->CallModuleMethod( |
| 208 "app", "onInstallStateResponse", arraysize(argv), argv); |
208 } | 209 } |
209 | 210 |
210 } // namespace extensions | 211 } // namespace extensions |
OLD | NEW |