diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 21:09:14 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 21:09:14 +0000 |
commit | cff386ccf5eb4de8bc409b85da0855e610824b24 (patch) | |
tree | 0a1b9d4c4abc26258d4b0f1cc9bac4bf326913de /chrome/browser/gtk/extension_popup_gtk.cc | |
parent | 76fbe717255e22a0d326b518165750e8d27a82cb (diff) | |
download | chromium_src-cff386ccf5eb4de8bc409b85da0855e610824b24.zip chromium_src-cff386ccf5eb4de8bc409b85da0855e610824b24.tar.gz chromium_src-cff386ccf5eb4de8bc409b85da0855e610824b24.tar.bz2 |
Port BrowserActionApiTest.BrowserActionPopup to linux.
Also make the test proprely wait for the EXTENSION_HOST_DID_STOP_LOADING signal.
BUG=29710
TEST=compiles
Review URL: http://codereview.chromium.org/515065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/extension_popup_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/extension_popup_gtk.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/gtk/extension_popup_gtk.cc b/chrome/browser/gtk/extension_popup_gtk.cc index e14ff90..75fab2df 100644 --- a/chrome/browser/gtk/extension_popup_gtk.cc +++ b/chrome/browser/gtk/extension_popup_gtk.cc @@ -16,6 +16,8 @@ #include "chrome/common/notification_service.h" #include "googleurl/src/gurl.h" +ExtensionPopupGtk* ExtensionPopupGtk::current_extension_popup_ = NULL; + ExtensionPopupGtk::ExtensionPopupGtk(Browser* browser, ExtensionHost* host, const gfx::Rect& relative_to) @@ -61,6 +63,10 @@ void ExtensionPopupGtk::ShowPopup() { return; } + // Only one instance should be showing at a time. + DCHECK(!current_extension_popup_); + current_extension_popup_ = this; + // We'll be in the upper-right corner of the window for LTR languages, so we // want to put the arrow at the upper-right corner of the bubble to match the // page and app menus. @@ -77,17 +83,19 @@ void ExtensionPopupGtk::ShowPopup() { this); } -void ExtensionPopupGtk::DestroyPopup() { +bool ExtensionPopupGtk::DestroyPopup() { if (!bubble_) { NOTREACHED(); - return; + return false; } bubble_->Close(); + return true; } void ExtensionPopupGtk::InfoBubbleClosing(InfoBubbleGtk* bubble, bool closed_by_escape) { + current_extension_popup_ = NULL; delete this; } @@ -104,3 +112,7 @@ void ExtensionPopupGtk::Show(const GURL& url, Browser* browser, // This object will delete itself when the info bubble is closed. new ExtensionPopupGtk(browser, host, relative_to); } + +gfx::Rect ExtensionPopupGtk::GetViewBounds() { + return gfx::Rect(host_->view()->native_view()->allocation); +} |