From fc9656edd36841cfb69c10539209b59872042513 Mon Sep 17 00:00:00 2001 From: "pkasting@google.com" Date: Wed, 30 Jul 2008 22:40:08 +0000 Subject: Simple change to make the "New [incognito] window" commands work like you'd expect. The old behavior disabled "New incognito window" when in incognito windows, created a new incognito tab instead of a new window when you already had an incognito window open, and gave you no way to get a non-incognito window from an incognito one. Now, both commands are always enabled, and both do exactly what they say they'll do no matter what type of window you're currently in. BUG=1190035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser.cc | 3 --- chrome/browser/browser_commands.cc | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 72f5afd..be59357 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -863,9 +863,6 @@ void Browser::UpdateNavigationCommands() { controller_.UpdateCommandEnabled(IDC_PRINT, web_contents != NULL); controller_.UpdateCommandEnabled(IDC_DUPLICATE, CanDuplicateContentsAt(selected_index())); - - controller_.UpdateCommandEnabled(IDC_GOOFFTHERECORD, - profile_->GetOffTheRecordProfile() != profile_); } // Notification that the starredness of a tab changed. diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc index 974a4f3..2489b9d 100644 --- a/chrome/browser/browser_commands.cc +++ b/chrome/browser/browser_commands.cc @@ -144,7 +144,7 @@ void Browser::InitCommandState() { controller_.UpdateCommandEnabled(IDC_PRINT, true); controller_.UpdateCommandEnabled(IDC_COPY_URL, true); controller_.UpdateCommandEnabled(IDC_DUPLICATE, true); - controller_.UpdateCommandEnabled(IDC_GOOFFTHERECORD, false); + controller_.UpdateCommandEnabled(IDC_GOOFFTHERECORD, true); controller_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, true); controller_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); controller_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, true); @@ -357,7 +357,8 @@ void Browser::ExecuteCommand(int id) { case IDC_NEWWINDOW: UserMetrics::RecordAction(L"NewWindow", profile_); - Browser::OpenNewBrowserWindow(profile_, SW_SHOWNORMAL); + Browser::OpenNewBrowserWindow(profile_->GetOriginalProfile(), + SW_SHOWNORMAL); break; case IDC_CLOSEWINDOW: @@ -523,7 +524,8 @@ void Browser::ExecuteCommand(int id) { } case IDC_GOOFFTHERECORD: { - Browser::OpenURLOffTheRecord(profile_, NewTabUIURL()); + Browser::OpenNewBrowserWindow(profile_->GetOffTheRecordProfile(), + SW_SHOWNORMAL); break; } -- cgit v1.1