Skip to content

Commit

Permalink
nw2: fix blur event -- switching to other windows #7327
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Jan 22, 2020
1 parent bec96d8 commit a825767
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chrome/browser/extensions/api/tabs/tabs_event_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ void TabsEventRouter::OnBrowserSetLastActive(Browser* browser) {
}
}

void TabsEventRouter::OnBrowserNoLongerActive(Browser* browser) {
TabsWindowsAPI* tabs_window_api = TabsWindowsAPI::Get(profile_);
if (tabs_window_api) {
tabs_window_api->windows_event_router()->OnActiveWindowChanged(NULL);
}
}

void TabsEventRouter::OnTabStripModelChanged(
TabStripModel* tab_strip_model,
const TabStripModelChange& change,
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/api/tabs/tabs_event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class TabsEventRouter : public TabStripModelObserver,

// BrowserListObserver:
void OnBrowserSetLastActive(Browser* browser) override;
void OnBrowserNoLongerActive(Browser* browser) override;

// TabStripModelObserver:
void OnTabStripModelChanged(
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/ui/browser_tab_strip_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ void BrowserTabStripTracker::OnBrowserSetLastActive(Browser* browser) {
if (browser_list_observer_)
browser_list_observer_->OnBrowserSetLastActive(browser);
}

void BrowserTabStripTracker::OnBrowserNoLongerActive(Browser* browser) {
if (browser_list_observer_)
browser_list_observer_->OnBrowserNoLongerActive(browser);
}
1 change: 1 addition & 0 deletions chrome/browser/ui/browser_tab_strip_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class BrowserTabStripTracker : public BrowserListObserver {
void OnBrowserAdded(Browser* browser) override;
void OnBrowserRemoved(Browser* browser) override;
void OnBrowserSetLastActive(Browser* browser) override;
void OnBrowserNoLongerActive(Browser* browser) override;

TabStripModelObserver* tab_strip_model_observer_;
BrowserTabStripTrackerDelegate* delegate_;
Expand Down

0 comments on commit a825767

Please sign in to comment.