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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_view_gtk.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/gtk/extensions/extension_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
index 97f52ec5bff8c58c54b642d06770b3b218bf8691..d1675eea1bf2a11aed01fd0ff453acd6b0fdbfb0 100644
--- a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
+#include "chrome/common/chrome_view_type.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
@@ -38,9 +39,9 @@ void ExtensionViewGtk::SetBackground(const SkBitmap& background) {
}
}
-void ExtensionViewGtk::UpdatePreferredSize(const gfx::Size& new_size) {
+void ExtensionViewGtk::ResizeDueToAutoResize(const gfx::Size& new_size) {
if (container_)
- container_->OnExtensionPreferredSizeChanged(this, new_size);
+ container_->OnExtensionSizeChanged(this, new_size);
}
void ExtensionViewGtk::CreateWidgetHostView() {
@@ -53,9 +54,12 @@ void ExtensionViewGtk::RenderViewCreated() {
pending_background_.reset();
}
- // Tell the renderer not to draw scrollbars in popups unless the
- // popups are at the maximum allowed size.
- gfx::Size largest_popup_size(ExtensionPopupGtk::kMaxWidth,
- ExtensionPopupGtk::kMaxHeight);
- extension_host_->DisableScrollbarsForSmallWindows(largest_popup_size);
+ content::ViewType host_type = extension_host_->extension_host_type();
+ if (host_type == chrome::VIEW_TYPE_EXTENSION_POPUP) {
+ gfx::Size min_size(ExtensionPopupGtk::kMinWidth,
+ ExtensionPopupGtk::kMinHeight);
+ gfx::Size max_size(ExtensionPopupGtk::kMaxWidth,
+ ExtensionPopupGtk::kMaxHeight);
+ render_view_host()->EnableAutoResize(min_size, max_size);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698