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

Unified Diff: chrome/browser/ui/cocoa/location_bar/page_action_decoration.h

Issue 10559054: Animate the script badges. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move to extension action Created 8 years, 6 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
Index: chrome/browser/ui/cocoa/location_bar/page_action_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h
index e0e2ab63a136ff1a93d599411948f5b54fc69234..4d2622d6b7d09685a2e77d30297b2f6da63aee61 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h
@@ -6,11 +6,12 @@
#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_PAGE_ACTION_DECORATION_H_
#pragma once
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
#import "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
+#include "chrome/common/extensions/extension_action.h"
#include "googleurl/src/gurl.h"
-class ExtensionAction;
@class ExtensionActionContextMenu;
class LocationBarViewMac;
class Profile;
@@ -24,7 +25,8 @@ class WebContents;
class PageActionDecoration : public ImageDecoration,
public ImageLoadingTracker::Observer,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public ExtensionAction::IconAnimation::Observer {
public:
PageActionDecoration(LocationBarViewMac* owner,
Profile* profile,
@@ -65,6 +67,10 @@ class PageActionDecoration : public ImageDecoration,
// Show the popup in the frame, with the given URL.
void ShowPopup(const NSRect& frame, const GURL& popup_url);
+ // Overridden from ExtensionAction::IconAnimation::Observer.
+ virtual void OnIconChanged(
+ const ExtensionAction::IconAnimation& animation) OVERRIDE;
+
// Overridden from NotificationObserver:
virtual void Observe(int type,
const content::NotificationSource& source,
@@ -107,6 +113,9 @@ class PageActionDecoration : public ImageDecoration,
// extension.
bool preview_enabled_;
+ // Weak reference to the fade-in animation for the icon.
+ base::WeakPtr<ExtensionAction::IconAnimation> icon_animation_;
+
// Used to register for notifications received by
// NotificationObserver.
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698