| Index: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
|
| diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
|
| index 5e3f1adc3c4a76a4061f1bafdb69518de06cf43e..7cb61a3995f9c9a5d2925a9bd3f2f6d05b3dcffc 100644
|
| --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
|
| +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
|
| @@ -73,15 +73,8 @@ WebNavigationEventRouter::PendingWebContents::PendingWebContents(
|
| WebNavigationEventRouter::PendingWebContents::~PendingWebContents() {}
|
|
|
| WebNavigationEventRouter::WebNavigationEventRouter(Profile* profile)
|
| - : profile_(profile) {}
|
| -
|
| -WebNavigationEventRouter::~WebNavigationEventRouter() {
|
| - BrowserList::RemoveObserver(this);
|
| -}
|
| -
|
| -void WebNavigationEventRouter::Init() {
|
| - if (!registrar_.IsEmpty())
|
| - return;
|
| + : profile_(profile) {
|
| + CHECK(registrar_.IsEmpty());
|
| registrar_.Add(this,
|
| chrome::NOTIFICATION_RETARGETING,
|
| content::NotificationService::AllSources());
|
| @@ -99,6 +92,10 @@ void WebNavigationEventRouter::Init() {
|
| }
|
| }
|
|
|
| +WebNavigationEventRouter::~WebNavigationEventRouter() {
|
| + BrowserList::RemoveObserver(this);
|
| +}
|
| +
|
| void WebNavigationEventRouter::OnBrowserAdded(Browser* browser) {
|
| if (!profile_->IsSameProfile(browser->profile()))
|
| return;
|
|
|