| Index: chrome/browser/ui/views/extensions/extension_popup.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/extensions/extension_popup.cc (revision 67311)
|
| +++ chrome/browser/ui/views/extensions/extension_popup.cc (working copy)
|
| @@ -34,9 +34,10 @@
|
|
|
| using views::Widget;
|
|
|
| -// The minimum/maximum dimensions of the popup.
|
| +// The minimum, and default 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.
|
| +// The default maximum is an arbitrary number that should be smaller than most
|
| +// screens.
|
| const int ExtensionPopup::kMinWidth = 25;
|
| const int ExtensionPopup::kMinHeight = 25;
|
| const int ExtensionPopup::kMaxWidth = 800;
|
| @@ -76,6 +77,7 @@
|
| border_(NULL),
|
| border_view_(NULL),
|
| popup_chrome_(chrome),
|
| + max_size_(kMaxWidth, kMaxHeight),
|
| observer_(observer),
|
| anchor_position_(arrow_location),
|
| instance_lifetime_(new InternalRefCounter()){
|
| @@ -289,9 +291,10 @@
|
| void ExtensionPopup::OnExtensionPreferredSizeChanged(ExtensionView* view) {
|
| // Constrain the size to popup min/max.
|
| gfx::Size sz = view->GetPreferredSize();
|
| +
|
| view->SetBounds(view->x(), view->y(),
|
| - std::max(kMinWidth, std::min(kMaxWidth, sz.width())),
|
| - std::max(kMinHeight, std::min(kMaxHeight, sz.height())));
|
| + std::max(kMinWidth, std::min(max_size_.width(), sz.width())),
|
| + std::max(kMinHeight, std::min(max_size_.height(), sz.height())));
|
|
|
| // If popup_chrome_ == RECTANGLE_CHROME, the border is drawn in the client
|
| // area of the ExtensionView, rather than in a window which sits behind it.
|
| @@ -387,6 +390,9 @@
|
| inspect_with_devtools, chrome,
|
| observer);
|
|
|
| + if (observer)
|
| + observer->ExtensionPopupCreated(popup);
|
| +
|
| // If the host had somehow finished loading, then we'd miss the notification
|
| // and not show. This seems to happen in single-process mode.
|
| if (host->did_stop_loading())
|
|
|