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

Unified Diff: chrome/browser/ui/views/extensions/extension_popup.h

Issue 5254007: Addition of 'maxSize' to experimental popup extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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.h
===================================================================
--- chrome/browser/ui/views/extensions/extension_popup.h (revision 67311)
+++ chrome/browser/ui/views/extensions/extension_popup.h (working copy)
@@ -48,6 +48,11 @@
// Chrome-Frame. See extension_popup_api.cc.
virtual void ExtensionHostCreated(ExtensionHost* host) {}
+ // Called immediately after a popup is created, but before the hosted
+ // extension has loaded and before the popup has been displayed. Use to
+ // finalize configuration of |popup|.
+ virtual void ExtensionPopupCreated(ExtensionPopup* popup) {}
+
// Called when the ExtensionPopup is resized. Note that the popup may have
// an empty bounds, if a popup is repositioned before the hosted content
// has loaded.
@@ -96,6 +101,13 @@
PopupChrome chrome,
Observer* observer);
+ // Assigns the maximal width and height, respectively, to which the popup
+ // may expand. If these routines are not called, the popup will resize to
+ // no larger than |kMaxWidth| x |kMaxHeight|. Note that the popup will
+ // never expand to larger than the dimensions of the screen.
+ void set_max_width(int width) { max_size_.set_width(width); }
+ void set_max_height(int height) { max_size_.set_height(height); }
+
// Closes the ExtensionPopup (this will cause the delegate
// ExtensionPopupIsClosing and ExtensionPopupClosed to fire.
void Close();
@@ -203,6 +215,9 @@
// The type of chrome associated with the popup window.
PopupChrome popup_chrome_;
+ // The maximal size to which the popup may expand.
+ gfx::Size max_size_;
+
// The observer of this popup.
Observer* observer_;
« no previous file with comments | « chrome/browser/extensions/extension_popup_api.cc ('k') | chrome/browser/ui/views/extensions/extension_popup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698