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

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

Issue 496403003: Remove NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master for CQ Created 6 years, 4 months 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/extensions/page_action_controller.cc ('k') | extensions/browser/notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index a2f6d3d7852427d9a44317e9a4e8d8ce2d381cc1..3e86f3632d830de34e02728f478d7528865ea38d 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -143,10 +143,6 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
new ContentSettingDecoration(type, this, profile));
}
- registrar_.Add(
- this,
- extensions::NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED,
- content::NotificationService::AllSources());
content::Source<Profile> profile_source = content::Source<Profile>(profile);
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
@@ -227,6 +223,9 @@ void LocationBarViewMac::UpdateManagePasswordsIconAndBubble() {
void LocationBarViewMac::UpdatePageActions() {
RefreshPageActionDecorations();
Layout();
+
+ [field_ updateMouseTracking];
+ [field_ setNeedsDisplay:YES];
}
void LocationBarViewMac::InvalidatePageActions() {
@@ -624,25 +623,10 @@ NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) {
void LocationBarViewMac::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case extensions::NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED: {
- if (content::Source<WebContents>(source).ptr() != GetWebContents())
- return;
-
- [field_ updateMouseTracking];
- [field_ setNeedsDisplay:YES];
- break;
- }
-
- case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
- case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
- Update(NULL);
- break;
+ DCHECK(type == extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED ||
+ type == extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED);
- default:
- NOTREACHED() << "Unexpected notification";
- break;
- }
+ Update(NULL);
}
void LocationBarViewMac::ModelChanged(const SearchModel::State& old_state,
« no previous file with comments | « chrome/browser/extensions/page_action_controller.cc ('k') | extensions/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698