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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm

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/cocoa/extensions/extension_popup_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index 5bc804be3f6796f9680bbc1ab5a8ea6210875aee..814f202195daeba29f48427de4c83245a2d1159d 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -28,6 +28,7 @@
using content::BrowserContext;
using content::RenderViewHost;
+using content::WebContents;
namespace {
// The duration for any animations that might be invoked by this controller.
@@ -92,7 +93,7 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
public:
explicit DevtoolsNotificationBridge(ExtensionPopupController* controller)
: controller_(controller),
- render_view_host_([controller_ extensionViewHost]->render_view_host()),
+ web_contents_([controller_ extensionViewHost]->host_contents()),
devtools_callback_(base::Bind(
&DevtoolsNotificationBridge::OnDevToolsStateChanged,
base::Unretained(this))) {
@@ -107,7 +108,7 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
void OnDevToolsStateChanged(content::DevToolsAgentHost* agent_host,
bool attached) {
- if (agent_host->GetRenderViewHost() != render_view_host_)
+ if (agent_host->GetWebContents() != web_contents_)
return;
if (attached) {
@@ -143,10 +144,10 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
private:
ExtensionPopupController* controller_;
- // RenderViewHost for controller. Hold onto this separately because we need to
+ // WebContents for controller. Hold onto this separately because we need to
// know what it is for notifications, but our ExtensionViewHost may not be
// valid.
- RenderViewHost* render_view_host_;
+ WebContents* web_contents_;
base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
};
@@ -208,7 +209,7 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
}
- (void)showDevTools {
- DevToolsWindow::OpenDevToolsWindow(host_->render_view_host());
+ DevToolsWindow::OpenDevToolsWindow(host_->host_contents());
}
- (void)close {

Powered by Google App Engine
This is Rietveld 408576698