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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 6272016: Prevent non-Incognito windows in the Guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser
Patch Set: fixed problem with PersonalDataManager Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/browser_url_handler.h" 9 #include "chrome/browser/browser_url_handler.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 params->target_contents = tab; 98 params->target_contents = tab;
99 return i; 99 return i;
100 } 100 }
101 } 101 }
102 102
103 return -1; 103 return -1;
104 } 104 }
105 105
106 // Change some of the navigation parameters based on the particular URL. 106 // Change some of the navigation parameters based on the particular URL.
107 // Currently this applies to chrome://settings and the bookmark manager, 107 // Currently this applies to chrome://settings and the bookmark manager,
108 // which we always want to open in a normal (not incognito) window. 108 // which we always want to open in a normal (not incognito) window. Guest
109 // session is an exception.
109 void AdjustNavigateParamsForURL(browser::NavigateParams* params) { 110 void AdjustNavigateParamsForURL(browser::NavigateParams* params) {
110 if (!params->target_contents && 111 if (!params->target_contents &&
111 params->url.scheme() == chrome::kChromeUIScheme && 112 params->url.scheme() == chrome::kChromeUIScheme &&
112 (params->url.host() == chrome::kChromeUISettingsHost || 113 (params->url.host() == chrome::kChromeUISettingsHost ||
113 params->url.host() == chrome::kChromeUIBookmarksHost)) { 114 params->url.host() == chrome::kChromeUIBookmarksHost)) {
114 Profile* profile = 115 Profile* profile =
115 params->browser ? params->browser->profile() : params->profile; 116 params->browser ? params->browser->profile() : params->profile;
116 117
117 if (profile->IsOffTheRecord()) { 118 if (profile->IsOffTheRecord() && !Profile::IsGuestSession()) {
Ben Goodger (Google) 2011/01/28 19:12:08 Can you add a unit test?
altimofeev 2011/01/31 16:26:40 Added browsertest. Can you take another look?
118 profile = profile->GetOriginalProfile(); 119 profile = profile->GetOriginalProfile();
119 120
120 params->disposition = SINGLETON_TAB; 121 params->disposition = SINGLETON_TAB;
121 params->profile = profile; 122 params->profile = profile;
122 params->browser = Browser::GetOrCreateTabbedBrowser(profile); 123 params->browser = Browser::GetOrCreateTabbedBrowser(profile);
123 params->show_window = true; 124 params->show_window = true;
124 } 125 }
125 } 126 }
126 } 127 }
127 128
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 params->url, params->referrer, params->transition); 468 params->url, params->referrer, params->transition);
468 } 469 }
469 470
470 // If the singleton tab isn't already selected, select it. 471 // If the singleton tab isn't already selected, select it.
471 if (params->source_contents != params->target_contents) 472 if (params->source_contents != params->target_contents)
472 params->browser->SelectTabContentsAt(singleton_index, user_initiated); 473 params->browser->SelectTabContentsAt(singleton_index, user_initiated);
473 } 474 }
474 } 475 }
475 476
476 } // namespace browser 477 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698