#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/notification_service.h"
#include "extensions/browser/event_router.h"
-#include "extensions/browser/extension_system.h"
-
-#if defined(TOOLKIT_GTK)
-#include "ui/base/x/active_window_watcher_x.h"
-#endif
using content::BrowserContext;
WindowControllerList::GetInstance()->AddObserver(this);
#if defined(TOOLKIT_VIEWS)
views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this);
-#elif defined(TOOLKIT_GTK)
- ui::ActiveWindowWatcherX::AddObserver(this);
#elif defined(OS_MACOSX)
// Needed for when no suitable window can be passed to an extension as the
// currently focused window.
WindowControllerList::GetInstance()->RemoveObserver(this);
#if defined(TOOLKIT_VIEWS)
views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
-#elif defined(TOOLKIT_GTK)
- ui::ActiveWindowWatcherX::RemoveObserver(this);
#endif
}
if (!focused_now)
OnActiveWindowChanged(NULL);
}
-#elif defined(TOOLKIT_GTK)
-void WindowsEventRouter::ActiveWindowChanged(
- GdkWindow* active_window) {
- if (!active_window)
- OnActiveWindowChanged(NULL);
-}
#endif
void WindowsEventRouter::Observe(
base::Bind(&WillDispatchWindowFocusedEvent,
static_cast<BrowserContext*>(window_profile),
window_id);
- ExtensionSystem::Get(profile_)->event_router()->BroadcastEvent(event.Pass());
+ EventRouter::Get(profile_)->BroadcastEvent(event.Pass());
}
void WindowsEventRouter::DispatchEvent(const std::string& event_name,
scoped_ptr<base::ListValue> args) {
scoped_ptr<Event> event(new Event(event_name, args.Pass()));
event->restrict_to_browser_context = profile;
- ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass());
+ EventRouter::Get(profile)->BroadcastEvent(event.Pass());
}
} // namespace extensions