| 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 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/metrics/user_metrics.h" | 38 #include "chrome/browser/metrics/user_metrics.h" |
| 39 #include "chrome/browser/net/url_fixer_upper.h" | 39 #include "chrome/browser/net/url_fixer_upper.h" |
| 40 #include "chrome/browser/options_util.h" | 40 #include "chrome/browser/options_util.h" |
| 41 #include "chrome/browser/options_window.h" | 41 #include "chrome/browser/options_window.h" |
| 42 #include "chrome/browser/policy/managed_prefs_banner_base.h" | 42 #include "chrome/browser/policy/managed_prefs_banner_base.h" |
| 43 #include "chrome/browser/prefs/pref_service.h" | 43 #include "chrome/browser/prefs/pref_service.h" |
| 44 #include "chrome/browser/prefs/session_startup_pref.h" | 44 #include "chrome/browser/prefs/session_startup_pref.h" |
| 45 #include "chrome/browser/profile.h" | 45 #include "chrome/browser/profile.h" |
| 46 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 46 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 47 #include "chrome/browser/shell_integration.h" | 47 #include "chrome/browser/shell_integration.h" |
| 48 #include "chrome/browser/show_options_url.h" |
| 48 #include "chrome/browser/sync/profile_sync_service.h" | 49 #include "chrome/browser/sync/profile_sync_service.h" |
| 49 #include "chrome/browser/sync/sync_ui_util.h" | 50 #include "chrome/browser/sync/sync_ui_util.h" |
| 50 #include "chrome/browser/tab_contents/tab_contents.h" | 51 #include "chrome/browser/tab_contents/tab_contents.h" |
| 51 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/common/notification_details.h" | 53 #include "chrome/common/notification_details.h" |
| 53 #include "chrome/common/notification_observer.h" | 54 #include "chrome/common/notification_observer.h" |
| 54 #include "chrome/common/notification_type.h" | 55 #include "chrome/common/notification_type.h" |
| 55 #include "chrome/common/pref_names.h" | 56 #include "chrome/common/pref_names.h" |
| 56 #include "chrome/common/url_constants.h" | 57 #include "chrome/common/url_constants.h" |
| 57 #include "chrome/installer/util/google_update_settings.h" | 58 #include "chrome/installer/util/google_update_settings.h" |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 // Opens the "Content Settings" dialog. | 1482 // Opens the "Content Settings" dialog. |
| 1482 - (IBAction)showContentSettings:(id)sender { | 1483 - (IBAction)showContentSettings:(id)sender { |
| 1483 [ContentSettingsDialogController | 1484 [ContentSettingsDialogController |
| 1484 showContentSettingsForType:CONTENT_SETTINGS_TYPE_DEFAULT | 1485 showContentSettingsForType:CONTENT_SETTINGS_TYPE_DEFAULT |
| 1485 profile:profile_]; | 1486 profile:profile_]; |
| 1486 } | 1487 } |
| 1487 | 1488 |
| 1488 - (IBAction)privacyLearnMore:(id)sender { | 1489 - (IBAction)privacyLearnMore:(id)sender { |
| 1489 // We open a new browser window so the Options dialog doesn't get lost | 1490 // We open a new browser window so the Options dialog doesn't get lost |
| 1490 // behind other windows. | 1491 // behind other windows. |
| 1491 Browser* browser = Browser::Create(profile_); | 1492 browser::ShowOptionsURL( |
| 1492 browser->OpenURL(GURL(l10n_util::GetStringUTF16(IDS_LEARN_MORE_PRIVACY_URL)), | 1493 profile_, |
| 1493 GURL(), NEW_WINDOW, PageTransition::LINK); | 1494 GURL(l10n_util::GetStringUTF16(IDS_LEARN_MORE_PRIVACY_URL))); |
| 1494 } | 1495 } |
| 1495 | 1496 |
| 1496 - (IBAction)backgroundModeLearnMore:(id)sender { | 1497 - (IBAction)backgroundModeLearnMore:(id)sender { |
| 1497 // We open a new browser window so the Options dialog doesn't get lost | 1498 browser::ShowOptionsURL( |
| 1498 // behind other windows. | 1499 profile_, |
| 1499 Browser::Create(profile_)->OpenURL( | 1500 GURL(l10n_util::GetStringUTF16(IDS_LEARN_MORE_BACKGROUND_MODE_URL))); |
| 1500 GURL(l10n_util::GetStringUTF16(IDS_LEARN_MORE_BACKGROUND_MODE_URL)), | |
| 1501 GURL(), NEW_WINDOW, PageTransition::LINK); | |
| 1502 } | 1501 } |
| 1503 | 1502 |
| 1504 - (IBAction)resetAutoOpenFiles:(id)sender { | 1503 - (IBAction)resetAutoOpenFiles:(id)sender { |
| 1505 profile_->GetDownloadManager()->download_prefs()->ResetAutoOpen(); | 1504 profile_->GetDownloadManager()->download_prefs()->ResetAutoOpen(); |
| 1506 [self recordUserAction:UserMetricsAction("Options_ResetAutoOpenFiles")]; | 1505 [self recordUserAction:UserMetricsAction("Options_ResetAutoOpenFiles")]; |
| 1507 } | 1506 } |
| 1508 | 1507 |
| 1509 - (IBAction)openProxyPreferences:(id)sender { | 1508 - (IBAction)openProxyPreferences:(id)sender { |
| 1510 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: | 1509 NSArray* itemsToOpen = [NSArray arrayWithObject:[NSURL fileURLWithPath: |
| 1511 @"/System/Library/PreferencePanes/Network.prefPane"]]; | 1510 @"/System/Library/PreferencePanes/Network.prefPane"]]; |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 case OPTIONS_PAGE_ADVANCED: | 2112 case OPTIONS_PAGE_ADVANCED: |
| 2114 return underTheHoodView_; | 2113 return underTheHoodView_; |
| 2115 case OPTIONS_PAGE_DEFAULT: | 2114 case OPTIONS_PAGE_DEFAULT: |
| 2116 case OPTIONS_PAGE_COUNT: | 2115 case OPTIONS_PAGE_COUNT: |
| 2117 LOG(DFATAL) << "Invalid page value " << page; | 2116 LOG(DFATAL) << "Invalid page value " << page; |
| 2118 } | 2117 } |
| 2119 return basicsView_; | 2118 return basicsView_; |
| 2120 } | 2119 } |
| 2121 | 2120 |
| 2122 @end | 2121 @end |
| OLD | NEW |