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/extension_helper.h" | 5 #include "chrome/renderer/extensions/extension_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return; | 184 return; |
185 | 185 |
186 g_schedulers.Get()[frame] = new UserScriptIdleScheduler( | 186 g_schedulers.Get()[frame] = new UserScriptIdleScheduler( |
187 frame, extension_dispatcher_); | 187 frame, extension_dispatcher_); |
188 } | 188 } |
189 | 189 |
190 void ExtensionHelper::OnExtensionResponse(int request_id, | 190 void ExtensionHelper::OnExtensionResponse(int request_id, |
191 bool success, | 191 bool success, |
192 const std::string& response, | 192 const std::string& response, |
193 const std::string& error) { | 193 const std::string& error) { |
194 std::string extension_id; | 194 extension_dispatcher_->OnExtensionResponse(request_id, |
195 SchemaGeneratedBindings::HandleResponse( | 195 success, |
196 extension_dispatcher_->v8_context_set(), request_id, success, | 196 response, |
197 response, error, &extension_id); | 197 error); |
198 } | 198 } |
199 | 199 |
200 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, | 200 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, |
201 const std::string& function_name, | 201 const std::string& function_name, |
202 const ListValue& args, | 202 const ListValue& args, |
203 const GURL& event_url, | 203 const GURL& event_url, |
204 bool user_gesture) { | 204 bool user_gesture) { |
205 scoped_ptr<WebScopedUserGesture> web_user_gesture; | 205 scoped_ptr<WebScopedUserGesture> web_user_gesture; |
206 if (user_gesture) { | 206 if (user_gesture) { |
207 web_user_gesture.reset(new WebScopedUserGesture); | 207 web_user_gesture.reset(new WebScopedUserGesture); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 routing_id(), *pending_app_info_)); | 381 routing_id(), *pending_app_info_)); |
382 pending_app_info_.reset(NULL); | 382 pending_app_info_.reset(NULL); |
383 } | 383 } |
384 | 384 |
385 void ExtensionHelper::AddErrorToRootConsole(const string16& message) { | 385 void ExtensionHelper::AddErrorToRootConsole(const string16& message) { |
386 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 386 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
387 render_view()->GetWebView()->mainFrame()->addMessageToConsole( | 387 render_view()->GetWebView()->mainFrame()->addMessageToConsole( |
388 WebConsoleMessage(WebConsoleMessage::LevelError, message)); | 388 WebConsoleMessage(WebConsoleMessage::LevelError, message)); |
389 } | 389 } |
390 } | 390 } |
OLD | NEW |