Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: chrome/browser/ui/settings_window_manager.cc

Issue 595213005: Eliminate chrome::IsTrustedWindowWithScheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/settings_window_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&params);
- 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() &&
« no previous file with comments | « chrome/browser/ui/settings_window_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698