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

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

Issue 1549020: Add a scoped notifier for pref dictionaries / lists. (Closed)
Patch Set: Fix props. Created 10 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/pref_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/cocoa/preferences_window_controller.h" 5 #import "chrome/browser/cocoa/preferences_window_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/l10n_util_mac.h" 10 #include "app/l10n_util_mac.h"
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 SessionStartupPref::GetStartupPref(prefs_); 942 SessionStartupPref::GetStartupPref(prefs_);
943 [self setRestoreOnStartupIndex:startupPref.type]; 943 [self setRestoreOnStartupIndex:startupPref.type];
944 } 944 }
945 945
946 // TODO(beng): Note that the kURLsToRestoreOnStartup pref is a mutable list, 946 // TODO(beng): Note that the kURLsToRestoreOnStartup pref is a mutable list,
947 // and changes to mutable lists aren't broadcast through the 947 // and changes to mutable lists aren't broadcast through the
948 // observer system, so this condition will 948 // observer system, so this condition will
949 // never match. Once support for broadcasting such updates is 949 // never match. Once support for broadcasting such updates is
950 // added, this will automagically start to work, and this comment 950 // added, this will automagically start to work, and this comment
951 // can be removed. 951 // can be removed.
952 if (*prefName == prefs::kURLsToRestoreOnStartup) { 952 // TODO(chron): We comment out this block right now because we have put in
953 const SessionStartupPref startupPref = 953 // broadcast for notifications, but there's some workaround
954 SessionStartupPref::GetStartupPref(prefs_); 954 // currently present that causes an infinite loop.
955 [customPagesSource_ setURLs:startupPref.urls]; 955 // if (*prefName == prefs::kURLsToRestoreOnStartup) {
956 } 956 // const SessionStartupPref startupPref =
957 // SessionStartupPref::GetStartupPref(prefs_);
958 // [customPagesSource_ setURLs:startupPref.urls];
959 // }
957 960
958 if (*prefName == prefs::kHomePageIsNewTabPage) { 961 if (*prefName == prefs::kHomePageIsNewTabPage) {
959 NSInteger useNewTabPage = newTabPageIsHomePage_.GetValue() ? 0 : 1; 962 NSInteger useNewTabPage = newTabPageIsHomePage_.GetValue() ? 0 : 1;
960 [self setNewTabPageIsHomePageIndex:useNewTabPage]; 963 [self setNewTabPageIsHomePageIndex:useNewTabPage];
961 } 964 }
962 if (*prefName == prefs::kHomePage) { 965 if (*prefName == prefs::kHomePage) {
963 NSString* value = base::SysWideToNSString(homepage_.GetValue()); 966 NSString* value = base::SysWideToNSString(homepage_.GetValue());
964 [self setHomepageURL:value]; 967 [self setHomepageURL:value];
965 } 968 }
966 969
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 case OPTIONS_PAGE_ADVANCED: 1961 case OPTIONS_PAGE_ADVANCED:
1959 return underTheHoodView_; 1962 return underTheHoodView_;
1960 case OPTIONS_PAGE_DEFAULT: 1963 case OPTIONS_PAGE_DEFAULT:
1961 case OPTIONS_PAGE_COUNT: 1964 case OPTIONS_PAGE_COUNT:
1962 LOG(DFATAL) << "Invalid page value " << page; 1965 LOG(DFATAL) << "Invalid page value " << page;
1963 } 1966 }
1964 return basicsView_; 1967 return basicsView_;
1965 } 1968 }
1966 1969
1967 @end 1970 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698