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

Unified Diff: chrome/browser/ui/views/extensions/extension_popup.cc

Issue 363233002: Abstract base 'ExtensionView' to Fix DEPS violation in extension_view_host.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 6 years, 6 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/views/extensions/extension_popup.cc
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 9fa93b83a5e64e1ed6a4876c0bb1eb91e8051f62..5e7aa8a2598b6aff3ea975d372fd674cfae4eca0 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -51,8 +51,8 @@ ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host,
const int margin = views::BubbleBorder::GetCornerRadius() / 2;
set_margins(gfx::Insets(margin, margin, margin, margin));
SetLayoutManager(new views::FillLayout());
- AddChildView(host->view());
- host->view()->set_container(this);
+ AddChildView(GetExtensionView());
+ GetExtensionView()->set_container(this);
// ExtensionPopup closes itself on very specific de-activation conditions.
set_close_on_deactivate(false);
@@ -66,14 +66,14 @@ ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host,
content::DevToolsManager::GetInstance()->AddAgentStateCallback(
devtools_callback_);
- host_->view()->browser()->tab_strip_model()->AddObserver(this);
+ GetExtensionView()->GetBrowser()->tab_strip_model()->AddObserver(this);
}
ExtensionPopup::~ExtensionPopup() {
content::DevToolsManager::GetInstance()->RemoveAgentStateCallback(
devtools_callback_);
- host_->view()->browser()->tab_strip_model()->RemoveObserver(this);
+ GetExtensionView()->GetBrowser()->tab_strip_model()->RemoveObserver(this);
}
void ExtensionPopup::Observe(int type,
@@ -114,6 +114,10 @@ void ExtensionPopup::OnDevToolsStateChanged(
}
}
+ExtensionViewViews* ExtensionPopup::GetExtensionView() {
+ return static_cast<ExtensionViewViews*>(host()->view());
Peter Kasting 2014/07/07 22:42:23 Nit: Same comments
tapted 2014/07/08 07:11:51 Done.
+}
+
void ExtensionPopup::OnExtensionSizeChanged(ExtensionViewViews* view) {
SizeToContents();
}

Powered by Google App Engine
This is Rietveld 408576698