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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 667 |
668 base::FundamentalValue enabled(will_launch_at_login); | 668 base::FundamentalValue enabled(will_launch_at_login); |
669 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState", | 669 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState", |
670 enabled); | 670 enabled); |
671 } | 671 } |
672 #endif | 672 #endif |
673 } | 673 } |
674 | 674 |
675 void BrowserOptionsHandler::UpdateDefaultBrowserState() { | 675 void BrowserOptionsHandler::UpdateDefaultBrowserState() { |
676 // Check for side-by-side first. | 676 // Check for side-by-side first. |
677 if (!ShellIntegration::CanSetAsDefaultBrowser()) { | 677 if (ShellIntegration::CanSetAsDefaultBrowser() == |
| 678 ShellIntegration::CHANGE_DEFAULT_NOT_ALLOWED) { |
678 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS); | 679 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS); |
679 return; | 680 return; |
680 } | 681 } |
681 | 682 |
682 #if defined(OS_MACOSX) | 683 #if defined(OS_MACOSX) |
683 ShellIntegration::DefaultWebClientState state = | 684 ShellIntegration::DefaultWebClientState state = |
684 ShellIntegration::IsDefaultBrowser(); | 685 ShellIntegration::IsDefaultBrowser(); |
685 int status_string_id; | 686 int status_string_id; |
686 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT) | 687 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT) |
687 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 688 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 else if (state == ShellIntegration::STATE_NOT_DEFAULT) | 735 else if (state == ShellIntegration::STATE_NOT_DEFAULT) |
735 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 736 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
736 else if (state == ShellIntegration::STATE_UNKNOWN) | 737 else if (state == ShellIntegration::STATE_UNKNOWN) |
737 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 738 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
738 else | 739 else |
739 return; // Still processing. | 740 return; // Still processing. |
740 | 741 |
741 SetDefaultBrowserUIString(status_string_id); | 742 SetDefaultBrowserUIString(status_string_id); |
742 } | 743 } |
743 | 744 |
| 745 bool BrowserOptionsHandler::IsInteractiveSetDefaultPermitted() { |
| 746 return true; // This is UI so we can allow it. |
| 747 } |
| 748 |
744 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { | 749 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { |
745 scoped_ptr<Value> status_string(Value::CreateStringValue( | 750 scoped_ptr<Value> status_string(Value::CreateStringValue( |
746 l10n_util::GetStringFUTF16(status_string_id, | 751 l10n_util::GetStringFUTF16(status_string_id, |
747 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); | 752 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); |
748 | 753 |
749 scoped_ptr<Value> is_default(Value::CreateBooleanValue( | 754 scoped_ptr<Value> is_default(Value::CreateBooleanValue( |
750 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT)); | 755 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT)); |
751 | 756 |
752 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue( | 757 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue( |
753 !default_browser_policy_.IsManaged() && | 758 !default_browser_policy_.IsManaged() && |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 } | 1412 } |
1408 | 1413 |
1409 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1414 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1410 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1415 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1411 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1416 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1412 web_ui()->CallJavascriptFunction( | 1417 web_ui()->CallJavascriptFunction( |
1413 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1418 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1414 } | 1419 } |
1415 | 1420 |
1416 } // namespace options2 | 1421 } // namespace options2 |
OLD | NEW |