OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 | 672 |
673 base::FundamentalValue enabled(will_launch_at_login); | 673 base::FundamentalValue enabled(will_launch_at_login); |
674 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState", | 674 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState", |
675 enabled); | 675 enabled); |
676 } | 676 } |
677 #endif | 677 #endif |
678 } | 678 } |
679 | 679 |
680 void BrowserOptionsHandler::UpdateDefaultBrowserState() { | 680 void BrowserOptionsHandler::UpdateDefaultBrowserState() { |
681 // Check for side-by-side first. | 681 // Check for side-by-side first. |
682 if (!ShellIntegration::CanSetAsDefaultBrowser()) { | 682 if (ShellIntegration::CanSetAsDefaultBrowser() == |
| 683 ShellIntegration::CHANGE_DEFAULT_NOT_ALLOWED) { |
683 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS); | 684 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS); |
684 return; | 685 return; |
685 } | 686 } |
686 | 687 |
687 #if defined(OS_MACOSX) | 688 #if defined(OS_MACOSX) |
688 ShellIntegration::DefaultWebClientState state = | 689 ShellIntegration::DefaultWebClientState state = |
689 ShellIntegration::IsDefaultBrowser(); | 690 ShellIntegration::IsDefaultBrowser(); |
690 int status_string_id; | 691 int status_string_id; |
691 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT) | 692 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT) |
692 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 693 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 else if (state == ShellIntegration::STATE_NOT_DEFAULT) | 740 else if (state == ShellIntegration::STATE_NOT_DEFAULT) |
740 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 741 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
741 else if (state == ShellIntegration::STATE_UNKNOWN) | 742 else if (state == ShellIntegration::STATE_UNKNOWN) |
742 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 743 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
743 else | 744 else |
744 return; // Still processing. | 745 return; // Still processing. |
745 | 746 |
746 SetDefaultBrowserUIString(status_string_id); | 747 SetDefaultBrowserUIString(status_string_id); |
747 } | 748 } |
748 | 749 |
| 750 bool BrowserOptionsHandler::IsInteractiveSetDefaultPermitted() { |
| 751 return true; // This is UI so we can allow it. |
| 752 } |
| 753 |
749 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { | 754 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { |
750 scoped_ptr<Value> status_string(Value::CreateStringValue( | 755 scoped_ptr<Value> status_string(Value::CreateStringValue( |
751 l10n_util::GetStringFUTF16(status_string_id, | 756 l10n_util::GetStringFUTF16(status_string_id, |
752 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); | 757 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); |
753 | 758 |
754 scoped_ptr<Value> is_default(Value::CreateBooleanValue( | 759 scoped_ptr<Value> is_default(Value::CreateBooleanValue( |
755 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT)); | 760 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT)); |
756 | 761 |
757 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue( | 762 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue( |
758 !default_browser_policy_.IsManaged() && | 763 !default_browser_policy_.IsManaged() && |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 } | 1426 } |
1422 | 1427 |
1423 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1428 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1424 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1429 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1425 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1430 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1426 web_ui()->CallJavascriptFunction( | 1431 web_ui()->CallJavascriptFunction( |
1427 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1432 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1428 } | 1433 } |
1429 | 1434 |
1430 } // namespace options2 | 1435 } // namespace options2 |
OLD | NEW |