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

Side by Side Diff: chrome/browser/cocoa/preferences_window_controller.mm

Issue 102015: Add a very basic preferences window controller with unit test. Fix the prefs ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/cocoa/preferences_window_controller.h"
6
7 #include "base/mac_util.h"
8 #include "chrome/common/pref_service.h"
9
10 PreferencesWindowController* gPrefWindowSingleton = nil;
11
12 @implementation PreferencesWindowController
13
14 - (id)initWithPrefs:(PrefService*)prefs {
15 DCHECK(prefs);
16 // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we
17 // can override it in a unit test.
18 NSString *nibpath = [mac_util::MainAppBundle()
19 pathForResource:@"Preferences"
20 ofType:@"nib"];
21 if ((self = [super initWithWindowNibPath:nibpath owner:self])) {
22 prefs_ = prefs;
23 }
24 return self;
25 }
26
27 - (void)awakeFromNib {
28
TVL 2009/04/30 17:50:31 todo?
29 }
30
31 // Synchronizes the window's UI elements with the values in |prefs_|.
32 - (void)syncWithPrefs {
33 // TODO(pinkerton): do it...
34 }
35
36 // Show the preferences window.
37 - (IBAction)showPreferences:(id)sender {
38 [self syncWithPrefs];
39 [self showWindow:sender];
40 }
41
42 // Called when the window is being closed. Send out a notification that the
43 // user is done editing preferences.
44 - (void)windowWillClose:(NSNotification *)notification {
45 // TODO(pinkerton): send notification. Write unit test that makes sure
46 // we receive it.
47 }
48
49 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/preferences_window_controller.h ('k') | chrome/browser/cocoa/preferences_window_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698