summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authorcsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 01:29:42 +0000
committercsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 01:29:42 +0000
commit4a42d27f346529b37f839b27b8b1dedd7e507002 (patch)
tree73c407a059acf1fc1252c64c201a5253135a28c2 /chrome/browser/app_controller_mac.mm
parent988506992537ed14bc02c00a2bae38088befcc0e (diff)
downloadchromium_src-4a42d27f346529b37f839b27b8b1dedd7e507002.zip
chromium_src-4a42d27f346529b37f839b27b8b1dedd7e507002.tar.gz
chromium_src-4a42d27f346529b37f839b27b8b1dedd7e507002.tar.bz2
Enable domui options for use in browser using the switch:
--enable-tabbed-options BUG=none TEST=see description Review URL: http://codereview.chromium.org/2820007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm20
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index b44398a..0ed8a0d 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -783,6 +783,9 @@ void RecordLastRunAppBundlePath() {
defaultProfile);
TaskManagerMac::Show();
break;
+ case IDC_OPTIONS:
+ [self showPreferences:sender];
+ break;
}
}
@@ -926,9 +929,20 @@ void RecordLastRunAppBundlePath() {
// Show the preferences window, or bring it to the front if it's already
// visible.
- (IBAction)showPreferences:(id)sender {
- [self showPreferencesWindow:sender
- page:OPTIONS_PAGE_DEFAULT
- profile:[self defaultProfile]];
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
+ if (parsed_command_line.HasSwitch(switches::kEnableTabbedOptions)) {
+ if (Browser* browser = ActivateBrowser([self defaultProfile])) {
+ // Show options tab in the active browser window.
+ browser->ShowOptionsTab();
+ } else {
+ // No browser window, so create one for the options tab.
+ Browser::OpenOptionsWindow([self defaultProfile]);
+ }
+ } else {
+ [self showPreferencesWindow:sender
+ page:OPTIONS_PAGE_DEFAULT
+ profile:[self defaultProfile]];
+ }
}
- (void)showPreferencesWindow:(id)sender