diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 19:32:22 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 19:32:22 +0000 |
commit | 91a5b3e9f6fbdf10c2a031138ba902ebf612eadc (patch) | |
tree | 8be509fdea281740e0dcf153cf4a8f4ed8a9f547 /chrome | |
parent | 6828ad30f070ab8f9db629461c7eb68e3eeb51fd (diff) | |
download | chromium_src-91a5b3e9f6fbdf10c2a031138ba902ebf612eadc.zip chromium_src-91a5b3e9f6fbdf10c2a031138ba902ebf612eadc.tar.gz chromium_src-91a5b3e9f6fbdf10c2a031138ba902ebf612eadc.tar.bz2 |
Mac: enable History, Downloads, and Open Location... with no windows open.
BUG=25620
TEST=Close all windows, try History->History (Cmd-Y); close window, try Window->Downloads (Shift-Cmd-J); close window, try Open Location... (Cmd-L).
Review URL: http://codereview.chromium.org/329004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 10 | ||||
-rw-r--r-- | chrome/browser/browser.cc | 14 | ||||
-rw-r--r-- | chrome/browser/browser.h | 5 |
3 files changed, 28 insertions, 1 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index faf6789..d9c4082 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -495,6 +495,7 @@ static bool g_is_opening_new_window = false; switch (tag) { case IDC_NEW_TAB: case IDC_NEW_WINDOW: + case IDC_FOCUS_LOCATION: g_is_opening_new_window = true; Browser::OpenEmptyWindow(defaultProfile); g_is_opening_new_window = false; @@ -518,6 +519,12 @@ static bool g_is_opening_new_window = false; [controller runModalDialog]; break; } + case IDC_SHOW_HISTORY: + Browser::OpenHistoryWindow(defaultProfile); + break; + case IDC_SHOW_DOWNLOADS: + Browser::OpenDownloadsWindow(defaultProfile); + break; case IDC_HELP_PAGE: Browser::OpenHelpWindow(defaultProfile); break; @@ -552,6 +559,9 @@ static bool g_is_opening_new_window = false; menuState_->UpdateCommandEnabled(IDC_OPEN_FILE, true); menuState_->UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, true); menuState_->UpdateCommandEnabled(IDC_RESTORE_TAB, false); + menuState_->UpdateCommandEnabled(IDC_FOCUS_LOCATION, true); + menuState_->UpdateCommandEnabled(IDC_SHOW_HISTORY, true); + menuState_->UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); menuState_->UpdateCommandEnabled(IDC_HELP_PAGE, true); // TODO(pinkerton): ...more to come... } diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 619e855..a2a0e96 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -332,6 +332,20 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { #if defined(OS_MACOSX) // static +void Browser::OpenHistoryWindow(Profile* profile) { + Browser* browser = Browser::Create(profile); + browser->ShowHistoryTab(); + browser->window()->Show(); +} + +// static +void Browser::OpenDownloadsWindow(Profile* profile) { + Browser* browser = Browser::Create(profile); + browser->ShowDownloadsTab(); + browser->window()->Show(); +} + +// static void Browser::OpenHelpWindow(Profile* profile) { Browser* browser = Browser::Create(profile); browser->OpenHelpTab(); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index a6c15c2..2372f95 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -168,7 +168,10 @@ class Browser : public TabStripModelDelegate, static void OpenApplicationWindow(Profile* profile, const GURL& url); #if defined(OS_MACOSX) - // Open a new window with help (needed on Mac when there are no windows). + // Open a new window with history/downloads/help (needed on Mac when there are + // no windows). + static void OpenHistoryWindow(Profile* profile); + static void OpenDownloadsWindow(Profile* profile); static void OpenHelpWindow(Profile* profile); #endif |