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

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 8588013: Fix crash in SyncSetupWizard::IsVisible() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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 | « no previous file | chrome/browser/ui/browser_navigator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tabs_module.cc
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index e667cd27a975886824894911a43d17887e47e4c3..766e4f6de432c0ce73fdc802e97d55eed659cfeb 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -277,18 +277,17 @@ bool CreateWindowFunction::ShouldOpenIncognitoWindow(
incognito = true;
}
- // If we are opening an incognito window.
- if (incognito) {
+ // Remove all URLs that are not allowed in an incognito session. Note that a
+ // ChromeOS guest session is not considered incognito in this case.
+ if (incognito && !Profile::IsGuestSession()) {
std::string first_url_erased;
- // Guest session is an exception as it always opens in incognito mode.
for (size_t i = 0; i < urls->size();) {
- if (browser::IsURLAllowedInIncognito((*urls)[i]) &&
- !Profile::IsGuestSession()) {
+ if (browser::IsURLAllowedInIncognito((*urls)[i])) {
+ i++;
+ } else {
if (first_url_erased.empty())
first_url_erased = (*urls)[i].spec();
urls->erase(urls->begin() + i);
- } else {
- i++;
}
}
if (urls->empty() && !first_url_erased.empty()) {
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698