Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/browser/extensions/execute_code_in_tab_function.cc

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/extensions/execute_code_in_tab_function.h" 5 #include "chrome/browser/extensions/execute_code_in_tab_function.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 DCHECK(false); 217 DCHECK(false);
218 } 218 }
219 219
220 ExtensionMsg_ExecuteCode_Params params; 220 ExtensionMsg_ExecuteCode_Params params;
221 params.request_id = request_id(); 221 params.request_id = request_id();
222 params.extension_id = extension->id(); 222 params.extension_id = extension->id();
223 params.is_javascript = is_js_code; 223 params.is_javascript = is_js_code;
224 params.code = code_string; 224 params.code = code_string;
225 params.all_frames = all_frames_; 225 params.all_frames = all_frames_;
226 params.in_main_world = false; 226 params.in_main_world = false;
227 contents->render_view_host()->Send(new ExtensionMsg_ExecuteCode( 227 contents->tab_contents()->render_view_host()->Send(
228 contents->render_view_host()->routing_id(), params)); 228 new ExtensionMsg_ExecuteCode(
229 contents->tab_contents()->render_view_host()->routing_id(), params));
229 230
230 Observe(contents->tab_contents()); 231 Observe(contents->tab_contents());
231 AddRef(); // balanced in OnExecuteCodeFinished() 232 AddRef(); // balanced in OnExecuteCodeFinished()
232 return true; 233 return true;
233 } 234 }
234 235
235 bool ExecuteCodeInTabFunction::OnMessageReceived(const IPC::Message& message) { 236 bool ExecuteCodeInTabFunction::OnMessageReceived(const IPC::Message& message) {
236 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) 237 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID)
237 return false; 238 return false;
238 239
(...skipping 20 matching lines...) Expand all
259 if (!error.empty()) { 260 if (!error.empty()) {
260 CHECK(!success); 261 CHECK(!success);
261 error_ = error; 262 error_ = error;
262 } 263 }
263 264
264 SendResponse(success); 265 SendResponse(success);
265 266
266 Observe(NULL); 267 Observe(NULL);
267 Release(); // balanced in Execute() 268 Release(); // balanced in Execute()
268 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/extensions/extension_browsertests_misc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698