Chromium Code Reviews| Index: chrome/browser/ui/settings_window_manager.cc |
| diff --git a/chrome/browser/ui/settings_window_manager.cc b/chrome/browser/ui/settings_window_manager.cc |
| index c60d5aed54553007f0d27ccf234972e00a87785d..b4d1b4f0b484565417380485a0a180cd7918a4e1 100644 |
| --- a/chrome/browser/ui/settings_window_manager.cc |
| +++ b/chrome/browser/ui/settings_window_manager.cc |
| @@ -54,17 +54,18 @@ void SettingsWindowManager::ShowChromePageForProfile(Profile* profile, |
| } |
| // No existing browser window, create one. |
| - NavigateParams params(profile, gurl, ui::PAGE_TRANSITION_AUTO_BOOKMARK); |
| - params.disposition = NEW_POPUP; |
| - params.trusted_source = true; |
| - params.window_action = NavigateParams::SHOW_WINDOW; |
| - params.user_gesture = true; |
| - params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
| - chrome::Navigate(¶ms); |
| - settings_session_map_[profile] = params.browser->session_id().id(); |
| + navigate_params_.reset( |
| + new NavigateParams(profile, gurl, ui::PAGE_TRANSITION_AUTO_BOOKMARK)); |
| + navigate_params_->disposition = NEW_POPUP; |
| + navigate_params_->trusted_source = true; |
| + navigate_params_->window_action = NavigateParams::SHOW_WINDOW; |
| + navigate_params_->user_gesture = true; |
| + navigate_params_->path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
| + chrome::Navigate(navigate_params_.get()); |
| + settings_session_map_[profile] = navigate_params_->browser->session_id().id(); |
| FOR_EACH_OBSERVER(SettingsWindowManagerObserver, |
| - observers_, OnNewSettingsWindow(params.browser)); |
| + observers_, OnNewSettingsWindow(navigate_params_->browser)); |
|
Mr4D (OOO till 08-26)
2014/09/25 21:18:34
At this time you could destroy the navigate_params
stevenjb
2014/09/25 21:36:58
Good suggestion now that I think about it, will do
|
| } |
| Browser* SettingsWindowManager::FindBrowserForProfile(Profile* profile) { |
| @@ -75,6 +76,10 @@ Browser* SettingsWindowManager::FindBrowserForProfile(Profile* profile) { |
| } |
| bool SettingsWindowManager::IsSettingsBrowser(Browser* browser) const { |
| + // This may get called from chrome::Navigate, so first test to see if this |
| + // is the browser we most recently navigate to. |
|
Mr4D (OOO till 08-26)
2014/09/25 21:18:34
.. most recently navigated to.
stevenjb
2014/09/25 21:36:58
Done.
|
| + if (navigate_params_ && navigate_params_->browser == browser) |
|
Mr4D (OOO till 08-26)
2014/09/25 21:18:34
Don't really like this, but I do not see a good ot
stevenjb
2014/09/25 21:36:58
Right, pretty much the same conclusion I came to.
|
| + return true; |
| ProfileSessionMap::const_iterator iter = |
| settings_session_map_.find(browser->profile()); |
| return (iter != settings_session_map_.end() && |