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

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

Issue 3023023: [Mac] Fix the custom homepages preferences. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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
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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 // Cocoa Bindings. 877 // Cocoa Bindings.
878 // Handles prefs for the "Basics" panel. 878 // Handles prefs for the "Basics" panel.
879 - (void)basicsPrefChanged:(std::wstring*)prefName { 879 - (void)basicsPrefChanged:(std::wstring*)prefName {
880 if (*prefName == prefs::kRestoreOnStartup) { 880 if (*prefName == prefs::kRestoreOnStartup) {
881 const SessionStartupPref startupPref = 881 const SessionStartupPref startupPref =
882 SessionStartupPref::GetStartupPref(prefs_); 882 SessionStartupPref::GetStartupPref(prefs_);
883 [self setRestoreOnStartupIndex:startupPref.type]; 883 [self setRestoreOnStartupIndex:startupPref.type];
884 } 884 }
885 885
886 if (*prefName == prefs::kURLsToRestoreOnStartup) { 886 if (*prefName == prefs::kURLsToRestoreOnStartup) {
887 const SessionStartupPref startupPref = 887 [customPagesSource_ reloadURLs];
888 SessionStartupPref::GetStartupPref(prefs_);
889 [customPagesSource_ setURLs:startupPref.urls];
890 } 888 }
891 889
892 if (*prefName == prefs::kHomePageIsNewTabPage) { 890 if (*prefName == prefs::kHomePageIsNewTabPage) {
893 NSInteger useNewTabPage = newTabPageIsHomePage_.GetValue() ? 0 : 1; 891 NSInteger useNewTabPage = newTabPageIsHomePage_.GetValue() ? 0 : 1;
894 [self setNewTabPageIsHomePageIndex:useNewTabPage]; 892 [self setNewTabPageIsHomePageIndex:useNewTabPage];
895 } 893 }
896 if (*prefName == prefs::kHomePage) { 894 if (*prefName == prefs::kHomePage) {
897 NSString* value = base::SysUTF8ToNSString(homepage_.GetValue()); 895 NSString* value = base::SysUTF8ToNSString(homepage_.GetValue());
898 [self setHomepageURL:value]; 896 [self setHomepageURL:value];
899 } 897 }
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 case OPTIONS_PAGE_ADVANCED: 2064 case OPTIONS_PAGE_ADVANCED:
2067 return underTheHoodView_; 2065 return underTheHoodView_;
2068 case OPTIONS_PAGE_DEFAULT: 2066 case OPTIONS_PAGE_DEFAULT:
2069 case OPTIONS_PAGE_COUNT: 2067 case OPTIONS_PAGE_COUNT:
2070 LOG(DFATAL) << "Invalid page value " << page; 2068 LOG(DFATAL) << "Invalid page value " << page;
2071 } 2069 }
2072 return basicsView_; 2070 return basicsView_;
2073 } 2071 }
2074 2072
2075 @end 2073 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698