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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_window.h" | 10 #include "apps/app_window.h" |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 sync_ui_util::SYNC_ERROR; | 1356 sync_ui_util::SYNC_ERROR; |
1357 sync_status->SetString("statusText", status_label); | 1357 sync_status->SetString("statusText", status_label); |
1358 sync_status->SetString("actionLinkText", link_label); | 1358 sync_status->SetString("actionLinkText", link_label); |
1359 sync_status->SetBoolean("hasError", status_has_error); | 1359 sync_status->SetBoolean("hasError", status_has_error); |
1360 | 1360 |
1361 sync_status->SetBoolean("managed", service && service->IsManaged()); | 1361 sync_status->SetBoolean("managed", service && service->IsManaged()); |
1362 sync_status->SetBoolean("signedIn", | 1362 sync_status->SetBoolean("signedIn", |
1363 !signin->GetAuthenticatedUsername().empty()); | 1363 !signin->GetAuthenticatedUsername().empty()); |
1364 sync_status->SetBoolean("hasUnrecoverableError", | 1364 sync_status->SetBoolean("hasUnrecoverableError", |
1365 service && service->HasUnrecoverableError()); | 1365 service && service->HasUnrecoverableError()); |
| 1366 sync_status->SetBoolean( |
| 1367 "autoLoginVisible", |
| 1368 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && |
| 1369 service && service->IsSyncEnabledAndLoggedIn() && |
| 1370 service->IsOAuthRefreshTokenAvailable()); |
1366 | 1371 |
1367 return sync_status.Pass(); | 1372 return sync_status.Pass(); |
1368 } | 1373 } |
1369 | 1374 |
1370 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1375 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
1371 const base::ListValue* args) { | 1376 const base::ListValue* args) { |
1372 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1377 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1373 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1378 select_folder_dialog_ = ui::SelectFileDialog::Create( |
1374 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1379 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
1375 ui::SelectFileDialog::FileTypeInfo info; | 1380 ui::SelectFileDialog::FileTypeInfo info; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 void BrowserOptionsHandler::SetupEasyUnlock() { | 1814 void BrowserOptionsHandler::SetupEasyUnlock() { |
1810 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() | 1815 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() |
1811 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); | 1816 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); |
1812 base::FundamentalValue has_pairing_value(has_pairing); | 1817 base::FundamentalValue has_pairing_value(has_pairing); |
1813 web_ui()->CallJavascriptFunction( | 1818 web_ui()->CallJavascriptFunction( |
1814 "BrowserOptions.updateEasyUnlock", | 1819 "BrowserOptions.updateEasyUnlock", |
1815 has_pairing_value); | 1820 has_pairing_value); |
1816 } | 1821 } |
1817 | 1822 |
1818 } // namespace options | 1823 } // namespace options |
OLD | NEW |