diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 16:46:11 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 16:46:11 +0000 |
commit | ce5c4504531cfd32972dfd123f98183c3706951a (patch) | |
tree | 679f14d1ea5738a6bedb752a4c61b7f3c50efde1 /chrome/browser/views/location_bar_view.cc | |
parent | aec92f83d096ca57ab6ce515ae7063b8081b630e (diff) | |
download | chromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.zip chromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.tar.gz chromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.tar.bz2 |
PageActions now work across tabs and windows.
The extension system now provides TabId to extensions so it is now possible to activate PageActions in other tabs besides the first in the tab strip. :)
BUG=None
TEST=None (requires a PageAction extension to test against).
Review URL: http://codereview.chromium.org/109046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/location_bar_view.cc')
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 0686de8..d7267ea 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -583,11 +583,10 @@ void LocationBarView::RefreshPageActionViews() { TabContents* contents = delegate_->GetTabContents(); if (!page_action_image_views_.empty() && contents) { - int tab_id = ExtensionTabUtil::GetTabId(contents); GURL url = GURL(model_->GetText()); for (size_t i = 0; i < page_action_image_views_.size(); i++) - page_action_image_views_[i]->UpdateVisibility(tab_id, url); + page_action_image_views_[i]->UpdateVisibility(contents, url); } } @@ -1143,11 +1142,13 @@ void LocationBarView::PageActionImageView::ShowInfoBubble() { } void LocationBarView::PageActionImageView::UpdateVisibility( - int tab_id, GURL url) { - current_tab_id_ = tab_id; + TabContents* contents, GURL url) { + // Save this off so we can pass it back to the extension when the action gets + // executed. See PageActionImageView::OnMousePressed. + current_tab_id_ = ExtensionTabUtil::GetTabId(contents); current_url_ = url; - SetVisible(page_action_->IsActive(current_tab_id_, current_url_)); + SetVisible(contents->IsPageActionEnabled(page_action_)); } void LocationBarView::PageActionImageView::OnIconLoaded( |