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

Unified Diff: chrome/browser/ui/webui/extensions/extension_error_ui_util.cc

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments addressed. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/extensions/extension_error_ui_util.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_error_ui_util.cc b/chrome/browser/ui/webui/extensions/extension_error_ui_util.cc
index dd13202c5aeca35359b6f29f24ff96a91f63ffcf..23d9ed77b1b190fa7a4091417fba77c531ef3039 100644
--- a/chrome/browser/ui/webui/extensions/extension_error_ui_util.cc
+++ b/chrome/browser/ui/webui/extensions/extension_error_ui_util.cc
@@ -157,6 +157,12 @@ void HandleOpenDevTools(const base::DictionaryValue* args) {
if (!rvh)
return;
+ // Once we open the inspector, we focus on the appropriate tab...
dgozman 2014/08/07 12:06:27 You forgot to remove comment from here :-)
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ if (!web_contents)
+ return;
+
// If we include a url, we should inspect it specifically (and not just the
// render view).
base::string16 url;
@@ -170,15 +176,13 @@ void HandleOpenDevTools(const base::DictionaryValue* args) {
// Line/column numbers are reported in display-friendly 1-based numbers,
// but are inspected in zero-based numbers.
DevToolsWindow::OpenDevToolsWindow(
- rvh,
+ web_contents,
DevToolsToggleAction::Reveal(url, line_number - 1, column_number - 1));
} else {
- DevToolsWindow::OpenDevToolsWindow(rvh);
+ DevToolsWindow::OpenDevToolsWindow(web_contents);
}
// Once we open the inspector, we focus on the appropriate tab...
- content::WebContents* web_contents =
- content::WebContents::FromRenderViewHost(rvh);
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
// ... but some pages (popups and apps) don't have tabs, and some (background

Powered by Google App Engine
This is Rietveld 408576698