| Index: chrome/browser/extensions/window_event_router.cc
|
| diff --git a/chrome/browser/extensions/window_event_router.cc b/chrome/browser/extensions/window_event_router.cc
|
| index b90e04a29d6cb0a3d24da117fb57550325655913..efd48d7dcb0560dd15f4145d3279e7a98843a00b 100644
|
| --- a/chrome/browser/extensions/window_event_router.cc
|
| +++ b/chrome/browser/extensions/window_event_router.cc
|
| @@ -24,27 +24,10 @@ namespace event_names = extensions::event_names;
|
| namespace extensions {
|
|
|
| WindowEventRouter::WindowEventRouter(Profile* profile)
|
| - : initialized_(false),
|
| - profile_(profile),
|
| + : profile_(profile),
|
| focused_profile_(NULL),
|
| focused_window_id_(extension_misc::kUnknownWindowId) {
|
| DCHECK(!profile->IsOffTheRecord());
|
| -}
|
| -
|
| -WindowEventRouter::~WindowEventRouter() {
|
| - if (initialized_) {
|
| - WindowControllerList::GetInstance()->RemoveObserver(this);
|
| -#if defined(TOOLKIT_VIEWS)
|
| - views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
|
| -#elif defined(TOOLKIT_GTK)
|
| - ui::ActiveWindowWatcherX::RemoveObserver(this);
|
| -#endif
|
| - }
|
| -}
|
| -
|
| -void WindowEventRouter::Init() {
|
| - if (initialized_)
|
| - return;
|
|
|
| WindowControllerList::GetInstance()->AddObserver(this);
|
| #if defined(TOOLKIT_VIEWS)
|
| @@ -57,8 +40,15 @@ void WindowEventRouter::Init() {
|
| registrar_.Add(this, chrome::NOTIFICATION_NO_KEY_WINDOW,
|
| content::NotificationService::AllSources());
|
| #endif
|
| +}
|
|
|
| - initialized_ = true;
|
| +WindowEventRouter::~WindowEventRouter() {
|
| + WindowControllerList::GetInstance()->RemoveObserver(this);
|
| +#if defined(TOOLKIT_VIEWS)
|
| + views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
|
| +#elif defined(TOOLKIT_GTK)
|
| + ui::ActiveWindowWatcherX::RemoveObserver(this);
|
| +#endif
|
| }
|
|
|
| void WindowEventRouter::OnWindowControllerAdded(
|
|
|