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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return; | 180 return; |
181 | 181 |
182 g_schedulers.Get()[frame] = new UserScriptIdleScheduler( | 182 g_schedulers.Get()[frame] = new UserScriptIdleScheduler( |
183 frame, extension_dispatcher_); | 183 frame, extension_dispatcher_); |
184 } | 184 } |
185 | 185 |
186 void ExtensionHelper::OnExtensionResponse(int request_id, | 186 void ExtensionHelper::OnExtensionResponse(int request_id, |
187 bool success, | 187 bool success, |
188 const std::string& response, | 188 const std::string& response, |
189 const std::string& error) { | 189 const std::string& error) { |
190 std::string extension_id; | 190 extension_dispatcher_->OnExtensionResponse(request_id, |
191 SchemaGeneratedBindings::HandleResponse( | 191 success, |
192 extension_dispatcher_->v8_context_set(), request_id, success, | 192 response, |
193 response, error, &extension_id); | 193 error); |
194 } | 194 } |
195 | 195 |
196 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, | 196 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, |
197 const std::string& function_name, | 197 const std::string& function_name, |
198 const ListValue& args, | 198 const ListValue& args, |
199 const GURL& event_url, | 199 const GURL& event_url, |
200 bool user_gesture) { | 200 bool user_gesture) { |
201 scoped_ptr<WebScopedUserGesture> web_user_gesture; | 201 scoped_ptr<WebScopedUserGesture> web_user_gesture; |
202 if (user_gesture) { | 202 if (user_gesture) { |
203 web_user_gesture.reset(new WebScopedUserGesture); | 203 web_user_gesture.reset(new WebScopedUserGesture); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 routing_id(), *pending_app_info_)); | 356 routing_id(), *pending_app_info_)); |
357 pending_app_info_.reset(NULL); | 357 pending_app_info_.reset(NULL); |
358 } | 358 } |
359 | 359 |
360 void ExtensionHelper::AddErrorToRootConsole(const string16& message) { | 360 void ExtensionHelper::AddErrorToRootConsole(const string16& message) { |
361 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 361 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
362 render_view()->GetWebView()->mainFrame()->addMessageToConsole( | 362 render_view()->GetWebView()->mainFrame()->addMessageToConsole( |
363 WebConsoleMessage(WebConsoleMessage::LevelError, message)); | 363 WebConsoleMessage(WebConsoleMessage::LevelError, message)); |
364 } | 364 } |
365 } | 365 } |
OLD | NEW |