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

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

Issue 9702068: Move extension pop-ups and notifications to the new auto-resize code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small update Created 8 years, 9 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_view.cc
diff --git a/chrome/browser/ui/views/extensions/extension_view.cc b/chrome/browser/ui/views/extensions/extension_view.cc
index fd5861f47cdafa33ba1d909a02c735cd9e95f708..a6cdcc77fc58a724a47e906a22d72393108ae78a 100644
--- a/chrome/browser/ui/views/extensions/extension_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_view.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
+#include "chrome/common/chrome_view_type.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -89,7 +90,7 @@ void ExtensionView::ShowIfCompletelyLoaded() {
// actually been created. These can happen in different orders.
if (host_->did_stop_loading()) {
SetVisible(true);
- UpdatePreferredSize(pending_preferred_size_);
+ ResizeDueToAutoResize(pending_preferred_size_);
}
}
@@ -110,7 +111,7 @@ void ExtensionView::SetBackground(const SkBitmap& background) {
ShowIfCompletelyLoaded();
}
-void ExtensionView::UpdatePreferredSize(const gfx::Size& new_size) {
+void ExtensionView::ResizeDueToAutoResize(const gfx::Size& new_size) {
// Don't actually do anything with this information until we have been shown.
// Size changes will not be honored by lower layers while we are hidden.
if (!visible()) {
@@ -134,7 +135,7 @@ void ExtensionView::ViewHierarchyChanged(bool is_add,
void ExtensionView::PreferredSizeChanged() {
View::PreferredSizeChanged();
if (container_)
- container_->OnExtensionPreferredSizeChanged(this);
+ container_->OnExtensionSizeChanged(this);
}
bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) {
@@ -163,11 +164,14 @@ void ExtensionView::RenderViewCreated() {
pending_background_.reset();
}
- // Tell the renderer not to draw scroll bars in popups unless the
- // popups are at the maximum allowed size.
- gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth,
- ExtensionPopup::kMaxHeight);
- host_->DisableScrollbarsForSmallWindows(largest_popup_size);
+ content::ViewType host_type = host_->extension_host_type();
+ if (host_type == chrome::VIEW_TYPE_EXTENSION_POPUP) {
+ gfx::Size min_size(ExtensionPopup::kMinWidth,
+ ExtensionPopup::kMinHeight);
+ gfx::Size max_size(ExtensionPopup::kMaxWidth,
+ ExtensionPopup::kMaxHeight);
+ render_view_host()->EnableAutoResize(min_size, max_size);
+ }
if (container_)
container_->OnViewWasResized();

Powered by Google App Engine
This is Rietveld 408576698