diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 20:19:20 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 20:19:20 +0000 |
commit | 2d8d923da42df61e9d65942945456d4b9304ef8e (patch) | |
tree | 21150546eca2423887f1cca5f9fe7a58ef08224a /chrome/browser/extensions/extension_host.cc | |
parent | 9e0dfa8ae69f71441d62f725441f7075f791bd09 (diff) | |
download | chromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.zip chromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.tar.gz chromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.tar.bz2 |
Add simple popup support to browser actions. This will create a popup HTML window that extends below a browser action button when the browser is clicked. When it loses focus, it is automatically dismissed.
BUG=23596
TEST=none
Review URL: http://codereview.chromium.org/258011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_host.cc')
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 0f3f6d8..3baa908 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -295,21 +295,23 @@ void ExtensionHost::InsertThemeCSS() { } void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) { - if (!did_stop_loading_) { - did_stop_loading_ = true; - LOG(INFO) << "Sending EXTENSION_HOST_DID_STOP_LOADING"; - NotificationService::current()->Notify( - NotificationType::EXTENSION_HOST_DID_STOP_LOADING, - Source<Profile>(profile_), - Details<ExtensionHost>(this)); - } + bool notify = !did_stop_loading_; + did_stop_loading_ = true; if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || - extension_host_type_ == ViewType::EXTENSION_MOLE) { + extension_host_type_ == ViewType::EXTENSION_MOLE || + extension_host_type_ == ViewType::EXTENSION_POPUP) { #if defined(TOOLKIT_VIEWS) if (view_.get()) view_->DidStopLoading(); #endif } + if (notify) { + LOG(INFO) << "Sending EXTENSION_HOST_DID_STOP_LOADING"; + NotificationService::current()->Notify( + NotificationType::EXTENSION_HOST_DID_STOP_LOADING, + Source<Profile>(profile_), + Details<ExtensionHost>(this)); + } } void ExtensionHost::DocumentAvailableInMainFrame(RenderViewHost* rvh) { @@ -488,7 +490,9 @@ void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { int ExtensionHost::GetBrowserWindowID() const { int window_id = -1; - if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP) { + if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || + extension_host_type_ == ViewType::EXTENSION_MOLE || + extension_host_type_ == ViewType::EXTENSION_POPUP) { window_id = ExtensionTabUtil::GetWindowId( const_cast<ExtensionHost* >(this)->GetBrowser()); } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |