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

Side by Side Diff: chrome/renderer/extensions/extension_helper.cc

Issue 10826141: Formalise a CHECK for the NULL NavigationEntry in ScriptBadgeController, and (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: win compile fix Created 8 years, 4 months 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
OLDNEW
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 render_view()); 338 render_view());
339 } 339 }
340 340
341 void ExtensionHelper::OnExecuteCode( 341 void ExtensionHelper::OnExecuteCode(
342 const ExtensionMsg_ExecuteCode_Params& params) { 342 const ExtensionMsg_ExecuteCode_Params& params) {
343 WebView* webview = render_view()->GetWebView(); 343 WebView* webview = render_view()->GetWebView();
344 WebFrame* main_frame = webview->mainFrame(); 344 WebFrame* main_frame = webview->mainFrame();
345 if (!main_frame) { 345 if (!main_frame) {
346 ListValue val; 346 ListValue val;
347 Send(new ExtensionHostMsg_ExecuteCodeFinished( 347 Send(new ExtensionHostMsg_ExecuteCodeFinished(
348 routing_id(), params.request_id, false, -1, "", val)); 348 routing_id(), params.request_id, "No main frame", -1, GURL(""), val));
349 return; 349 return;
350 } 350 }
351 351
352 // chrome.tabs.executeScript() only supports execution in either the top frame 352 // chrome.tabs.executeScript() only supports execution in either the top frame
353 // or all frames. We handle both cases in the top frame. 353 // or all frames. We handle both cases in the top frame.
354 SchedulerMap::iterator i = g_schedulers.Get().find(main_frame); 354 SchedulerMap::iterator i = g_schedulers.Get().find(main_frame);
355 if (i != g_schedulers.Get().end()) 355 if (i != g_schedulers.Get().end())
356 i->second->ExecuteCode(params); 356 i->second->ExecuteCode(params);
357 } 357 }
358 358
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 target_level = WebConsoleMessage::LevelWarning; 510 target_level = WebConsoleMessage::LevelWarning;
511 break; 511 break;
512 case content::CONSOLE_MESSAGE_LEVEL_ERROR: 512 case content::CONSOLE_MESSAGE_LEVEL_ERROR:
513 target_level = WebConsoleMessage::LevelError; 513 target_level = WebConsoleMessage::LevelError;
514 break; 514 break;
515 } 515 }
516 render_view()->GetWebView()->mainFrame()->addMessageToConsole( 516 render_view()->GetWebView()->mainFrame()->addMessageToConsole(
517 WebConsoleMessage(target_level, message)); 517 WebConsoleMessage(target_level, message));
518 } 518 }
519 } 519 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/user_script_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698