#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
-#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
+#include "chrome/browser/ui/zoom/zoom_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/event_router.h"
namespace content {
class WebContents;
// extension processes in the same profile.
class TabsEventRouter : public TabStripModelObserver,
public chrome::BrowserListObserver,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public ZoomObserver {
public:
explicit TabsEventRouter(Profile* profile);
virtual ~TabsEventRouter();
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+
+ // ZoomObserver.
+ virtual void OnZoomChanged(
+ const ZoomController::ZoomChangedEventData& data) OVERRIDE;
+
private:
// "Synthetic" event. Called from TabInsertedAt if new tab is detected.
void TabCreatedAt(content::WebContents* contents, int index, bool active);
// Packages |changed_properties| as a tab updated event for the tab |contents|
// and dispatches the event to the extension.
- void DispatchTabUpdatedEvent(content::WebContents* contents,
- scoped_ptr<DictionaryValue> changed_properties);
+ void DispatchTabUpdatedEvent(
+ content::WebContents* contents,
+ scoped_ptr<base::DictionaryValue> changed_properties);
// Register ourselves to receive the various notifications we are interested
// in for a browser.
// processing of TabChangedAt(). This method will "hold" a state-change
// to "loading", until the DidNavigate() method which should always follow
// it. Returns NULL if no updates should be sent.
- DictionaryValue* UpdateLoadState(const content::WebContents* contents);
+ base::DictionaryValue* UpdateLoadState(
+ const content::WebContents* contents);
// Indicates that a tab load has resulted in a navigation and the
// destination url is available for inspection. Returns NULL if no updates
// should be sent.
- DictionaryValue* DidNavigate(const content::WebContents* contents);
+ base::DictionaryValue* DidNavigate(const content::WebContents* contents);
private:
// Whether we are waiting to fire the 'complete' status change. This will
// Gets the TabEntry for the given |contents|. Returns TabEntry* if
// found, NULL if not.
- TabEntry* GetTabEntry(const content::WebContents* contents);
+ TabEntry* GetTabEntry(content::WebContents* contents);
std::map<int, TabEntry> tab_entries_;