Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / tabs / tabs_event_router.h
index 1c95f7a..b5ec372 100644 (file)
 #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;
@@ -28,7 +29,8 @@ namespace extensions {
 // 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();
@@ -70,6 +72,11 @@ class TabsEventRouter : public TabStripModelObserver,
   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);
@@ -101,8 +108,9 @@ class TabsEventRouter : public TabStripModelObserver,
 
   // 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.
@@ -135,12 +143,13 @@ class TabsEventRouter : public TabStripModelObserver,
     // 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
@@ -154,7 +163,7 @@ class TabsEventRouter : public TabStripModelObserver,
 
   // 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_;