| 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 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 sync_ui_util::SYNC_ERROR; | 1344 sync_ui_util::SYNC_ERROR; |
| 1345 sync_status->SetString("statusText", status_label); | 1345 sync_status->SetString("statusText", status_label); |
| 1346 sync_status->SetString("actionLinkText", link_label); | 1346 sync_status->SetString("actionLinkText", link_label); |
| 1347 sync_status->SetBoolean("hasError", status_has_error); | 1347 sync_status->SetBoolean("hasError", status_has_error); |
| 1348 | 1348 |
| 1349 sync_status->SetBoolean("managed", service && service->IsManaged()); | 1349 sync_status->SetBoolean("managed", service && service->IsManaged()); |
| 1350 sync_status->SetBoolean("signedIn", | 1350 sync_status->SetBoolean("signedIn", |
| 1351 !signin->GetAuthenticatedUsername().empty()); | 1351 !signin->GetAuthenticatedUsername().empty()); |
| 1352 sync_status->SetBoolean("hasUnrecoverableError", | 1352 sync_status->SetBoolean("hasUnrecoverableError", |
| 1353 service && service->HasUnrecoverableError()); | 1353 service && service->HasUnrecoverableError()); |
| 1354 sync_status->SetBoolean( | |
| 1355 "autoLoginVisible", | |
| 1356 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && | |
| 1357 service && service->IsSyncEnabledAndLoggedIn() && | |
| 1358 service->IsOAuthRefreshTokenAvailable()); | |
| 1359 | 1354 |
| 1360 return sync_status.Pass(); | 1355 return sync_status.Pass(); |
| 1361 } | 1356 } |
| 1362 | 1357 |
| 1363 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1358 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
| 1364 const base::ListValue* args) { | 1359 const base::ListValue* args) { |
| 1365 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1360 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1366 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1361 select_folder_dialog_ = ui::SelectFileDialog::Create( |
| 1367 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1362 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
| 1368 ui::SelectFileDialog::FileTypeInfo info; | 1363 ui::SelectFileDialog::FileTypeInfo info; |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 void BrowserOptionsHandler::SetupEasyUnlock() { | 1797 void BrowserOptionsHandler::SetupEasyUnlock() { |
| 1803 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() | 1798 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() |
| 1804 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); | 1799 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); |
| 1805 base::FundamentalValue has_pairing_value(has_pairing); | 1800 base::FundamentalValue has_pairing_value(has_pairing); |
| 1806 web_ui()->CallJavascriptFunction( | 1801 web_ui()->CallJavascriptFunction( |
| 1807 "BrowserOptions.updateEasyUnlock", | 1802 "BrowserOptions.updateEasyUnlock", |
| 1808 has_pairing_value); | 1803 has_pairing_value); |
| 1809 } | 1804 } |
| 1810 | 1805 |
| 1811 } // namespace options | 1806 } // namespace options |
| OLD | NEW |