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

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

Issue 11146023: Work on separate browser contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another busted command line flag Created 8 years, 2 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/browser_commands.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index ca12cb9d867f3fcae118b822e295cce25801b69b..fbc0859bab42e1ab68649d47b42ff6daaf097562 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -240,7 +240,7 @@ int GetContentRestrictions(const Browser* browser) {
return content_restrictions;
}
-void NewEmptyWindow(Profile* profile) {
+void NewEmptyWindow(Profile* profile, HostDesktopType desktop_type) {
bool incognito = profile->IsOffTheRecord();
PrefService* prefs = profile->GetPrefs();
if (incognito) {
@@ -258,25 +258,34 @@ void NewEmptyWindow(Profile* profile) {
if (incognito) {
content::RecordAction(UserMetricsAction("NewIncognitoWindow"));
- OpenEmptyWindow(profile->GetOffTheRecordProfile());
+ OpenEmptyWindow(profile->GetOffTheRecordProfile(), desktop_type);
} else {
content::RecordAction(UserMetricsAction("NewWindow"));
SessionService* session_service =
SessionServiceFactory::GetForProfile(profile->GetOriginalProfile());
if (!session_service ||
!session_service->RestoreIfNecessary(std::vector<GURL>())) {
- OpenEmptyWindow(profile->GetOriginalProfile());
+ OpenEmptyWindow(profile->GetOriginalProfile(), desktop_type);
}
}
}
-Browser* OpenEmptyWindow(Profile* profile) {
- Browser* browser = new Browser(Browser::CreateParams(profile));
+void NewEmptyWindow(Profile* profile) {
+ NewEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE);
+}
+
+Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) {
+ Browser* browser = new Browser(
+ Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type));
AddBlankTab(browser, true);
browser->window()->Show();
return browser;
}
+Browser* OpenEmptyWindow(Profile* profile) {
+ return OpenEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE);
+}
+
void OpenWindowWithRestoredTabs(Profile* profile) {
TabRestoreService* service = TabRestoreServiceFactory::GetForProfile(profile);
if (service)
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698