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

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, 5 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..cef0e7d42d62d6715e97b7c1e1dacefe237f0c2f 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -29,6 +29,14 @@
#include "ui/views/win/hwnd_util.h"
#endif
+namespace {
+
+ExtensionViewViews* GetExtensionView(extensions::ExtensionViewHost* host) {
+ return static_cast<ExtensionViewViews*>(host->view());
+}
+
+} // namespace
+
// The minimum/maximum dimensions of the popup.
// The minimum is just a little larger than the size of the button itself.
// The maximum is an arbitrary number that should be smaller than most screens.
@@ -51,8 +59,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(host));
+ GetExtensionView(host)->set_container(this);
// ExtensionPopup closes itself on very specific de-activation conditions.
set_close_on_deactivate(false);
@@ -66,14 +74,15 @@ ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host,
content::DevToolsManager::GetInstance()->AddAgentStateCallback(
devtools_callback_);
- host_->view()->browser()->tab_strip_model()->AddObserver(this);
+ GetExtensionView(host)->GetBrowser()->tab_strip_model()->AddObserver(this);
}
ExtensionPopup::~ExtensionPopup() {
content::DevToolsManager::GetInstance()->RemoveAgentStateCallback(
devtools_callback_);
- host_->view()->browser()->tab_strip_model()->RemoveObserver(this);
+ GetExtensionView(
+ host_.get())->GetBrowser()->tab_strip_model()->RemoveObserver(this);
}
void ExtensionPopup::Observe(int type,

Powered by Google App Engine
This is Rietveld 408576698