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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 391050: Implemented ShowOptionsWindow() for OS X (except the highlighting (Closed)
Patch Set: Fixed unittest. Created 11 years, 1 month 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 | « no previous file | chrome/browser/cocoa/preferences_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 4d36d3d2d8b5ccdcc320f460ccab0f892c1cc11f..03b3e12502941ec79f374664c496858f3163f12a 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -52,6 +52,9 @@
- (void)windowLayeringDidChange:(NSNotification*)inNotification;
- (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount;
- (BOOL)shouldQuitWithInProgressDownloads;
+- (void)showPreferencesWindow:(id)sender
+ page:(OptionsPage)page
+ profile:(Profile*)profile;
@end
// True while AppController is calling Browser::OpenEmptyWindow(). We need a
@@ -686,9 +689,20 @@ static bool g_is_opening_new_window = false;
// Show the preferences window, or bring it to the front if it's already
// visible.
- (IBAction)showPreferences:(id)sender {
- if (!prefsController_.get()) {
+ [self showPreferencesWindow:sender
+ page:OPTIONS_PAGE_DEFAULT
+ profile:[self defaultProfile]];
+}
+
+- (void)showPreferencesWindow:(id)sender
+ page:(OptionsPage)page
+ profile:(Profile*)profile {
+ if (prefsController_.get()) {
+ [prefsController_ switchToPage:page animate:YES];
+ } else {
prefsController_.reset([[PreferencesWindowController alloc]
- initWithProfile:[self defaultProfile]]);
+ initWithProfile:profile
+ initialPage:page]);
// Watch for a notification of when it goes away so that we can destroy
// the controller.
[[NSNotificationCenter defaultCenter]
@@ -762,11 +776,12 @@ static bool g_is_opening_new_window = false;
//---------------------------------------------------------------------------
-// Stub for cross-platform method that isn't called on Mac OS X.
void ShowOptionsWindow(OptionsPage page,
OptionsGroup highlight_group,
Profile* profile) {
- NOTIMPLEMENTED();
+ // TODO(akalin): Use highlight_group.
+ AppController* appController = [NSApp delegate];
+ [appController showPreferencesWindow:nil page:page profile:profile];
}
namespace app_controller_mac {
« no previous file with comments | « no previous file | chrome/browser/cocoa/preferences_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698