summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 00:36:18 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 00:36:18 +0000
commit1fdff70ba2db87257c213bb9b04749d139f15d70 (patch)
tree600acb159d89039fff0bb473c8b4da3b2257eaba /chrome
parent0cf8371778be69290c13e35a0abc6b6b402b0702 (diff)
downloadchromium_src-1fdff70ba2db87257c213bb9b04749d139f15d70.zip
chromium_src-1fdff70ba2db87257c213bb9b04749d139f15d70.tar.gz
chromium_src-1fdff70ba2db87257c213bb9b04749d139f15d70.tar.bz2
Mac: Enable help when there are no windows.
BUG=23825 TEST=Close all browser windows. Check that Help->Chromium Help (or Google Chrome Help) is enabled and works correctly. Review URL: http://codereview.chromium.org/303030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/app_controller_mac.mm7
-rw-r--r--chrome/browser/browser.cc9
-rw-r--r--chrome/browser/browser.h7
3 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index edf3615..434f61e 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -502,13 +502,17 @@
BrowserList::GetLastActive()->
ExecuteCommandWithDisposition(IDC_OPEN_FILE, CURRENT_TAB);
break;
- case IDC_CLEAR_BROWSING_DATA:
+ case IDC_CLEAR_BROWSING_DATA: {
// There may not be a browser open, so use the default profile.
scoped_nsobject<ClearBrowsingDataController> controller(
[[ClearBrowsingDataController alloc]
initWithProfile:defaultProfile]);
[controller runModalDialog];
break;
+ }
+ case IDC_HELP_PAGE:
+ Browser::OpenHelpWindow(defaultProfile);
+ break;
};
}
@@ -538,6 +542,7 @@
menuState_->UpdateCommandEnabled(IDC_OPEN_FILE, true);
menuState_->UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, true);
menuState_->UpdateCommandEnabled(IDC_RESTORE_TAB, false);
+ menuState_->UpdateCommandEnabled(IDC_HELP_PAGE, true);
// TODO(pinkerton): ...more to come...
}
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 86ac5c7..0bc169f 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -319,6 +319,15 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) {
tab_contents->view()->SetInitialFocus();
}
+#if defined(OS_MACOSX)
+// static
+void Browser::OpenHelpWindow(Profile* profile) {
+ Browser* browser = Browser::Create(profile);
+ browser->OpenHelpTab();
+ browser->window()->Show();
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
// Browser, State Storage and Retrieval for UI:
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 9fb8a4c..0f9cd60 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -155,9 +155,14 @@ class Browser : public TabStripModelDelegate,
// |profile|, that session is re-used.
static void OpenURLOffTheRecord(Profile* profile, const GURL& url);
- // Opens the a new application ("thin frame") window for the specified url.
+ // Opens a new application ("thin frame") window for the specified url.
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).
+ static void OpenHelpWindow(Profile* profile);
+#endif
+
// State Storage and Retrieval for UI ///////////////////////////////////////
// Save and restore the window position.