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

Unified Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 515027: Fixes bug where a Page Action icon was not being properly displayed upon page... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Second upload to get try server. Created 11 years 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
« no previous file with comments | « chrome/browser/cocoa/location_bar_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/location_bar_view_mac.mm
===================================================================
--- chrome/browser/cocoa/location_bar_view_mac.mm (revision 35229)
+++ chrome/browser/cocoa/location_bar_view_mac.mm (working copy)
@@ -99,6 +99,10 @@
AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];
[cell setSecurityImageView:&security_image_view_];
[cell setPageActionViewList:page_action_views_];
+
+ registrar_.Add(this,
+ NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
+ NotificationService::AllSources());
}
LocationBarViewMac::~LocationBarViewMac() {
@@ -397,6 +401,25 @@
[field_ resetFieldEditorFrameIfNeeded];
}
+void LocationBarViewMac::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ switch (type.value) {
+ case NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED: {
+ TabContents* contents =
+ BrowserList::GetLastActive()->GetSelectedTabContents();
+ if (Details<TabContents>(contents) != details)
+ return;
+
+ [field_ setNeedsDisplay:YES];
+ break;
+ }
+ default:
+ NOTREACHED() << "Unexpected notification";
+ break;
+ }
+}
+
// LocationBarImageView---------------------------------------------------------
void LocationBarViewMac::LocationBarImageView::SetImage(NSImage* image) {
« no previous file with comments | « chrome/browser/cocoa/location_bar_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698