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

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: Add browser test 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') | chrome/browser/ui/browser_navigator.cc » ('J')
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 a42096850aeccc6f71e96bbcceb37f91d2158e5f..8ce50cea823c49f3ccd4efd14dd4e697098fe3b0 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') | chrome/browser/ui/browser_navigator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698