summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:41:37 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:41:37 +0000
commitcd63ef62b897937521c6943b554608b3f9349d27 (patch)
treec79b4ff66eb7d1553095a6389c41f85bca9f2051 /chrome/browser/app_controller_mac.mm
parent8e80744e557dd436dd174b7f7203b4409b90c6e4 (diff)
downloadchromium_src-cd63ef62b897937521c6943b554608b3f9349d27.zip
chromium_src-cd63ef62b897937521c6943b554608b3f9349d27.tar.gz
chromium_src-cd63ef62b897937521c6943b554608b3f9349d27.tar.bz2
Implement most of the "basics" pref panel on Mac, including code to set the default browser. Fix up some related comments around the code.
Review URL: http://codereview.chromium.org/113032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index a75c0e5..2261342 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -15,6 +15,8 @@
#import "chrome/browser/cocoa/bookmark_menu_bridge.h"
#import "chrome/browser/cocoa/preferences_window_controller.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/common/temp_scaffolding_stubs.h"
@@ -28,12 +30,16 @@
@implementation AppController
+// This method is called very early in application startup (ie, before
+// the profile is loaded or any preferences have been registered). Defer any
+// user-data initialization until -applicationDidFinishLaunching:.
- (void)awakeFromNib {
// Set up the command updater for when there are no windows open
[self initMenuState];
- bookmarkMenuBridge_.reset(new BookmarkMenuBridge());
}
+// This is called after profiles have been loaded and preferences registered.
+// It is safe to access the default profile here.
- (void)applicationDidFinishLaunching:(NSNotification*)notify {
// Hold an extra ref to the BrowserProcess singleton so it doesn't go away
// when all the browser windows get closed. We'll release it on quit which
@@ -54,6 +60,12 @@
andSelector:@selector(openFiles:withReply:)
forEventClass:kCoreEventClass
andEventID:kAEOpenDocuments];
+
+ bookmarkMenuBridge_.reset(new BookmarkMenuBridge());
+
+ // Register any Mac-specific preferences.
+ PrefService* prefs = [self defaultProfile]->GetPrefs();
+ prefs->RegisterBooleanPref(prefs::kShowPageOptionsButtons, false);
}
- (void)dealloc {
@@ -243,9 +255,8 @@ void OpenURLs(const std::vector<GURL>& urls) {
// visible.
- (IBAction)showPreferences:(id)sender {
if (!prefsController_.get()) {
- PrefService* prefs = [self defaultProfile]->GetPrefs();
prefsController_.reset([[PreferencesWindowController alloc]
- initWithPrefs:prefs]);
+ initWithProfile:[self defaultProfile]]);
// Watch for a notification of when it goes away so that we can destroy
// the controller.
[[NSNotificationCenter defaultCenter]