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

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: rebase for r281699 (unused hwnd_util.h) 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 c1ad4b15fe48e85d3d5738bebdf561f2b5877287..68b0868f98910adef5cff528f9c19403cbe544fd 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -25,6 +25,14 @@
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_client.h"
+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.
@@ -47,8 +55,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);
@@ -62,14 +70,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,
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.cc ('k') | chrome/browser/ui/views/extensions/extension_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698