Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/ui/webui/options2/browser_options_handler2.cc

Issue 10453041: Support for interactive set-chrome-as-default in Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the reviewer's remark. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 668
669 base::FundamentalValue enabled(will_launch_at_login); 669 base::FundamentalValue enabled(will_launch_at_login);
670 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState", 670 web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState",
671 enabled); 671 enabled);
672 } 672 }
673 #endif 673 #endif
674 } 674 }
675 675
676 void BrowserOptionsHandler::UpdateDefaultBrowserState() { 676 void BrowserOptionsHandler::UpdateDefaultBrowserState() {
677 // Check for side-by-side first. 677 // Check for side-by-side first.
678 if (!ShellIntegration::CanSetAsDefaultBrowser()) { 678 if (ShellIntegration::CanSetAsDefaultBrowser() ==
679 ShellIntegration::SET_DEFAULT_NOT_ALLOWED) {
679 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS); 680 SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS);
680 return; 681 return;
681 } 682 }
682 683
683 #if defined(OS_MACOSX) 684 #if defined(OS_MACOSX)
684 ShellIntegration::DefaultWebClientState state = 685 ShellIntegration::DefaultWebClientState state =
685 ShellIntegration::IsDefaultBrowser(); 686 ShellIntegration::IsDefaultBrowser();
686 int status_string_id; 687 int status_string_id;
687 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT) 688 if (state == ShellIntegration::IS_DEFAULT_WEB_CLIENT)
688 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; 689 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 else if (state == ShellIntegration::STATE_NOT_DEFAULT) 736 else if (state == ShellIntegration::STATE_NOT_DEFAULT)
736 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; 737 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT;
737 else if (state == ShellIntegration::STATE_UNKNOWN) 738 else if (state == ShellIntegration::STATE_UNKNOWN)
738 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; 739 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN;
739 else 740 else
740 return; // Still processing. 741 return; // Still processing.
741 742
742 SetDefaultBrowserUIString(status_string_id); 743 SetDefaultBrowserUIString(status_string_id);
743 } 744 }
744 745
746 bool BrowserOptionsHandler::IsInteractiveSetDefaultPermitted() {
747 return true; // This is UI so we can allow it.
748 }
749
745 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) { 750 void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) {
746 scoped_ptr<Value> status_string(Value::CreateStringValue( 751 scoped_ptr<Value> status_string(Value::CreateStringValue(
747 l10n_util::GetStringFUTF16(status_string_id, 752 l10n_util::GetStringFUTF16(status_string_id,
748 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); 753 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))));
749 754
750 scoped_ptr<Value> is_default(Value::CreateBooleanValue( 755 scoped_ptr<Value> is_default(Value::CreateBooleanValue(
751 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT)); 756 status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT));
752 757
753 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue( 758 scoped_ptr<Value> can_be_default(Value::CreateBooleanValue(
754 !default_browser_policy_.IsManaged() && 759 !default_browser_policy_.IsManaged() &&
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1413 }
1409 1414
1410 void BrowserOptionsHandler::SetupSSLConfigSettings() { 1415 void BrowserOptionsHandler::SetupSSLConfigSettings() {
1411 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); 1416 base::FundamentalValue checked(rev_checking_enabled_.GetValue());
1412 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); 1417 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged());
1413 web_ui()->CallJavascriptFunction( 1418 web_ui()->CallJavascriptFunction(
1414 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); 1419 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled);
1415 } 1420 }
1416 1421
1417 } // namespace options2 1422 } // namespace options2
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/browser_options_handler2.h ('k') | chrome/installer/util/shell_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698