| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| 11 #include "chrome/browser/browser.h" | 11 #include "chrome/browser/browser.h" |
| 12 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" | 14 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" |
| 15 #import "chrome/browser/cocoa/custom_home_pages_model.h" | 15 #import "chrome/browser/cocoa/custom_home_pages_model.h" |
| 16 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" |
| 16 #import "chrome/browser/cocoa/search_engine_list_model.h" | 17 #import "chrome/browser/cocoa/search_engine_list_model.h" |
| 17 #include "chrome/browser/extensions/extensions_service.h" | 18 #include "chrome/browser/extensions/extensions_service.h" |
| 18 #include "chrome/browser/metrics/metrics_service.h" | 19 #include "chrome/browser/metrics/metrics_service.h" |
| 19 #include "chrome/browser/metrics/user_metrics.h" | 20 #include "chrome/browser/metrics/user_metrics.h" |
| 20 #include "chrome/browser/net/dns_global.h" | 21 #include "chrome/browser/net/dns_global.h" |
| 21 #include "chrome/browser/net/url_fixer_upper.h" | 22 #include "chrome/browser/net/url_fixer_upper.h" |
| 22 #include "chrome/browser/profile.h" | 23 #include "chrome/browser/profile.h" |
| 23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 24 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 24 #include "chrome/browser/session_startup_pref.h" | 25 #include "chrome/browser/session_startup_pref.h" |
| 25 #include "chrome/browser/shell_integration.h" | 26 #include "chrome/browser/shell_integration.h" |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 [self recordUserAction:L"Options_SearchEngineChanged"]; | 533 [self recordUserAction:L"Options_SearchEngineChanged"]; |
| 533 [searchEngineModel_ setDefaultIndex:index]; | 534 [searchEngineModel_ setDefaultIndex:index]; |
| 534 } | 535 } |
| 535 | 536 |
| 536 // Called when the search engine model changes. Update the selection in the | 537 // Called when the search engine model changes. Update the selection in the |
| 537 // popup by tickling the bindings with the new value. | 538 // popup by tickling the bindings with the new value. |
| 538 - (void)searchEngineModelChanged:(NSNotification*)notify { | 539 - (void)searchEngineModelChanged:(NSNotification*)notify { |
| 539 [self setSearchEngineSelectedIndex:[self searchEngineSelectedIndex]]; | 540 [self setSearchEngineSelectedIndex:[self searchEngineSelectedIndex]]; |
| 540 } | 541 } |
| 541 | 542 |
| 543 // Brings up the edit search engines window. |
| 544 - (IBAction)manageSearchEngines:(id)sender { |
| 545 KeywordEditorCocoaController* controller = |
| 546 [[KeywordEditorCocoaController alloc] initWithProfile:profile_]; |
| 547 [[controller window] makeKeyAndOrderFront:sender]; |
| 548 } |
| 549 |
| 542 // Called when the user clicks the button to make Chromium the default | 550 // Called when the user clicks the button to make Chromium the default |
| 543 // browser. Registers http and https. | 551 // browser. Registers http and https. |
| 544 - (IBAction)makeDefaultBrowser:(id)sender { | 552 - (IBAction)makeDefaultBrowser:(id)sender { |
| 545 [self willChangeValueForKey:@"defaultBrowser"]; | 553 [self willChangeValueForKey:@"defaultBrowser"]; |
| 546 | 554 |
| 547 ShellIntegration::SetAsDefaultBrowser(); | 555 ShellIntegration::SetAsDefaultBrowser(); |
| 548 [self recordUserAction:L"Options_SetAsDefaultBrowser"]; | 556 [self recordUserAction:L"Options_SetAsDefaultBrowser"]; |
| 549 // If the user made Chrome the default browser, then he/she arguably wants | 557 // If the user made Chrome the default browser, then he/she arguably wants |
| 550 // to be notified when that changes. | 558 // to be notified when that changes. |
| 551 prefs_->SetBoolean(prefs::kCheckDefaultBrowser, true); | 559 prefs_->SetBoolean(prefs::kCheckDefaultBrowser, true); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 [[NSNotificationCenter defaultCenter] | 950 [[NSNotificationCenter defaultCenter] |
| 943 postNotificationName:kUserDoneEditingPrefsNotification | 951 postNotificationName:kUserDoneEditingPrefsNotification |
| 944 object:self]; | 952 object:self]; |
| 945 } | 953 } |
| 946 | 954 |
| 947 - (void)controlTextDidEndEditing:(NSNotification*)notification { | 955 - (void)controlTextDidEndEditing:(NSNotification*)notification { |
| 948 [customPagesSource_ validateURLs]; | 956 [customPagesSource_ validateURLs]; |
| 949 } | 957 } |
| 950 | 958 |
| 951 @end | 959 @end |
| OLD | NEW |