Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 29 matching lines...) Expand all Loading... | |
| 40 #include "chrome/browser/options_window.h" | 40 #include "chrome/browser/options_window.h" |
| 41 #include "chrome/browser/options_util.h" | 41 #include "chrome/browser/options_util.h" |
| 42 #include "chrome/browser/pref_service.h" | 42 #include "chrome/browser/pref_service.h" |
| 43 #include "chrome/browser/profile.h" | 43 #include "chrome/browser/profile.h" |
| 44 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 44 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 45 #include "chrome/browser/session_startup_pref.h" | 45 #include "chrome/browser/session_startup_pref.h" |
| 46 #include "chrome/browser/shell_integration.h" | 46 #include "chrome/browser/shell_integration.h" |
| 47 #include "chrome/browser/sync/profile_sync_service.h" | 47 #include "chrome/browser/sync/profile_sync_service.h" |
| 48 #include "chrome/browser/sync/sync_ui_util.h" | 48 #include "chrome/browser/sync/sync_ui_util.h" |
| 49 #include "chrome/browser/tab_contents/tab_contents.h" | 49 #include "chrome/browser/tab_contents/tab_contents.h" |
| 50 #include "chrome/common/chrome_switches.h" | |
| 50 #include "chrome/common/notification_details.h" | 51 #include "chrome/common/notification_details.h" |
| 51 #include "chrome/common/notification_observer.h" | 52 #include "chrome/common/notification_observer.h" |
| 52 #include "chrome/common/notification_type.h" | 53 #include "chrome/common/notification_type.h" |
| 53 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 54 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
| 55 #include "chrome/installer/util/google_update_settings.h" | 56 #include "chrome/installer/util/google_update_settings.h" |
| 56 #include "grit/chromium_strings.h" | 57 #include "grit/chromium_strings.h" |
| 57 #include "grit/generated_resources.h" | 58 #include "grit/generated_resources.h" |
| 58 #include "grit/locale_settings.h" | 59 #include "grit/locale_settings.h" |
| 59 #include "grit/theme_resources.h" | 60 #include "grit/theme_resources.h" |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1267 didEndSelector:kEndSelector | 1268 didEndSelector:kEndSelector |
| 1268 contextInfo:NULL]; | 1269 contextInfo:NULL]; |
| 1269 } else { | 1270 } else { |
| 1270 // Otherwise, the sync button was a "sync my bookmarks" button. | 1271 // Otherwise, the sync button was a "sync my bookmarks" button. |
| 1271 // Kick off the sync setup process. | 1272 // Kick off the sync setup process. |
| 1272 syncService_->EnableForUser(); | 1273 syncService_->EnableForUser(); |
| 1273 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); | 1274 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); |
| 1274 } | 1275 } |
| 1275 } | 1276 } |
| 1276 | 1277 |
| 1278 // Called when the user clicks on the link to the privacy dashboard. | |
| 1279 - (IBAction)showPrivacyDashboard:(id)sender { | |
| 1280 Browser* browser = BrowserList::GetLastActive(); | |
| 1281 | |
| 1282 if (!browser || !browser->GetSelectedTabContents()) | |
| 1283 browser = Browser::Create(profile_); | |
| 1284 browser->OpenPrivacyDashboardTabAndActivate(); | |
| 1285 } | |
| 1286 | |
| 1277 // Called when the user clicks the "Customize Sync" button in the | 1287 // Called when the user clicks the "Customize Sync" button in the |
| 1278 // "Personal Stuff" pane. Spawns a dialog-modal sheet that cleans | 1288 // "Personal Stuff" pane. Spawns a dialog-modal sheet that cleans |
| 1279 // itself up on close. | 1289 // itself up on close. |
| 1280 - (IBAction)doSyncCustomize:(id)sender { | 1290 - (IBAction)doSyncCustomize:(id)sender { |
| 1281 syncService_->ShowChooseDataTypes(); | 1291 syncService_->ShowChooseDataTypes(); |
| 1282 } | 1292 } |
| 1283 | 1293 |
| 1284 - (IBAction)doSyncReauthentication:(id)sender { | 1294 - (IBAction)doSyncReauthentication:(id)sender { |
| 1285 DCHECK(syncService_); | 1295 DCHECK(syncService_); |
| 1286 syncService_->ShowLoginDialog(); | 1296 syncService_->ShowLoginDialog(); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1743 syncLinkNoErrorBackgroundColor_.reset( | 1753 syncLinkNoErrorBackgroundColor_.reset( |
| 1744 [[syncLinkCell backgroundColor] retain]); | 1754 [[syncLinkCell backgroundColor] retain]); |
| 1745 } | 1755 } |
| 1746 if (status == sync_ui_util::SYNC_ERROR) { | 1756 if (status == sync_ui_util::SYNC_ERROR) { |
| 1747 [syncStatus_ setBackgroundColor:syncErrorBackgroundColor_]; | 1757 [syncStatus_ setBackgroundColor:syncErrorBackgroundColor_]; |
| 1748 [syncLinkCell setBackgroundColor:syncErrorBackgroundColor_]; | 1758 [syncLinkCell setBackgroundColor:syncErrorBackgroundColor_]; |
| 1749 } else { | 1759 } else { |
| 1750 [syncStatus_ setBackgroundColor:syncStatusNoErrorBackgroundColor_]; | 1760 [syncStatus_ setBackgroundColor:syncStatusNoErrorBackgroundColor_]; |
| 1751 [syncLinkCell setBackgroundColor:syncLinkNoErrorBackgroundColor_]; | 1761 [syncLinkCell setBackgroundColor:syncLinkNoErrorBackgroundColor_]; |
| 1752 } | 1762 } |
| 1763 | |
|
akalin
2010/07/13 23:06:12
Add comment re. this leaving a space if there's no
| |
| 1764 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1765 switches::kShowPrivacyDashboardLink)) | |
| 1766 [privacyDashboardLink_ setHidden:YES]; | |
| 1753 } | 1767 } |
| 1754 | 1768 |
| 1755 // Show the preferences window. | 1769 // Show the preferences window. |
| 1756 - (IBAction)showPreferences:(id)sender { | 1770 - (IBAction)showPreferences:(id)sender { |
| 1757 [self showWindow:sender]; | 1771 [self showWindow:sender]; |
| 1758 } | 1772 } |
| 1759 | 1773 |
| 1760 - (IBAction)toolbarButtonSelected:(id)sender { | 1774 - (IBAction)toolbarButtonSelected:(id)sender { |
| 1761 DCHECK([sender isKindOfClass:[NSToolbarItem class]]); | 1775 DCHECK([sender isKindOfClass:[NSToolbarItem class]]); |
| 1762 OptionsPage page = [self getPageForToolbarItem:sender]; | 1776 OptionsPage page = [self getPageForToolbarItem:sender]; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2019 case OPTIONS_PAGE_ADVANCED: | 2033 case OPTIONS_PAGE_ADVANCED: |
| 2020 return underTheHoodView_; | 2034 return underTheHoodView_; |
| 2021 case OPTIONS_PAGE_DEFAULT: | 2035 case OPTIONS_PAGE_DEFAULT: |
| 2022 case OPTIONS_PAGE_COUNT: | 2036 case OPTIONS_PAGE_COUNT: |
| 2023 LOG(DFATAL) << "Invalid page value " << page; | 2037 LOG(DFATAL) << "Invalid page value " << page; |
| 2024 } | 2038 } |
| 2025 return basicsView_; | 2039 return basicsView_; |
| 2026 } | 2040 } |
| 2027 | 2041 |
| 2028 @end | 2042 @end |
| OLD | NEW |