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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 bool status_has_error = sync_ui_util::GetStatusLabels( | 1014 bool status_has_error = sync_ui_util::GetStatusLabels( |
1015 service, *signin, sync_ui_util::WITH_HTML, &status_label, &link_label) == | 1015 service, *signin, sync_ui_util::WITH_HTML, &status_label, &link_label) == |
1016 sync_ui_util::SYNC_ERROR; | 1016 sync_ui_util::SYNC_ERROR; |
1017 sync_status->SetString("statusText", status_label); | 1017 sync_status->SetString("statusText", status_label); |
1018 sync_status->SetString("actionLinkText", link_label); | 1018 sync_status->SetString("actionLinkText", link_label); |
1019 sync_status->SetBoolean("hasError", status_has_error); | 1019 sync_status->SetBoolean("hasError", status_has_error); |
1020 | 1020 |
1021 sync_status->SetBoolean("managed", service->IsManaged()); | 1021 sync_status->SetBoolean("managed", service->IsManaged()); |
1022 sync_status->SetBoolean("hasUnrecoverableError", | 1022 sync_status->SetBoolean("hasUnrecoverableError", |
1023 service->unrecoverable_error_detected()); | 1023 service->unrecoverable_error_detected()); |
1024 sync_status->SetBoolean("autoLoginVisible", | 1024 sync_status->SetBoolean( |
| 1025 "autoLoginVisible", |
1025 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && | 1026 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && |
1026 service->AreCredentialsAvailable()); | 1027 service->IsSyncEnabledAndLoggedIn() && service->IsSyncTokenAvailable()); |
1027 | 1028 |
1028 return sync_status.Pass(); | 1029 return sync_status.Pass(); |
1029 } | 1030 } |
1030 | 1031 |
1031 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1032 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
1032 const ListValue* args) { | 1033 const ListValue* args) { |
1033 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1034 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1034 select_folder_dialog_ = SelectFileDialog::Create(this); | 1035 select_folder_dialog_ = SelectFileDialog::Create(this); |
1035 select_folder_dialog_->SelectFile( | 1036 select_folder_dialog_->SelectFile( |
1036 SelectFileDialog::SELECT_FOLDER, | 1037 SelectFileDialog::SELECT_FOLDER, |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 } | 1410 } |
1410 | 1411 |
1411 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1412 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1412 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1413 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1413 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1414 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1414 web_ui()->CallJavascriptFunction( | 1415 web_ui()->CallJavascriptFunction( |
1415 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1416 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1416 } | 1417 } |
1417 | 1418 |
1418 } // namespace options2 | 1419 } // namespace options2 |
OLD | NEW |