| 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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 sync_ui_util::SYNC_ERROR; | 1337 sync_ui_util::SYNC_ERROR; |
| 1338 sync_status->SetString("statusText", status_label); | 1338 sync_status->SetString("statusText", status_label); |
| 1339 sync_status->SetString("actionLinkText", link_label); | 1339 sync_status->SetString("actionLinkText", link_label); |
| 1340 sync_status->SetBoolean("hasError", status_has_error); | 1340 sync_status->SetBoolean("hasError", status_has_error); |
| 1341 | 1341 |
| 1342 sync_status->SetBoolean("managed", service && service->IsManaged()); | 1342 sync_status->SetBoolean("managed", service && service->IsManaged()); |
| 1343 sync_status->SetBoolean("signedIn", | 1343 sync_status->SetBoolean("signedIn", |
| 1344 !signin->GetAuthenticatedUsername().empty()); | 1344 !signin->GetAuthenticatedUsername().empty()); |
| 1345 sync_status->SetBoolean("hasUnrecoverableError", | 1345 sync_status->SetBoolean("hasUnrecoverableError", |
| 1346 service && service->HasUnrecoverableError()); | 1346 service && service->HasUnrecoverableError()); |
| 1347 sync_status->SetBoolean( | |
| 1348 "autoLoginVisible", | |
| 1349 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && | |
| 1350 service && service->IsSyncEnabledAndLoggedIn() && | |
| 1351 service->IsOAuthRefreshTokenAvailable()); | |
| 1352 | 1347 |
| 1353 return sync_status.Pass(); | 1348 return sync_status.Pass(); |
| 1354 } | 1349 } |
| 1355 | 1350 |
| 1356 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1351 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
| 1357 const base::ListValue* args) { | 1352 const base::ListValue* args) { |
| 1358 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1353 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1359 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1354 select_folder_dialog_ = ui::SelectFileDialog::Create( |
| 1360 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1355 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
| 1361 ui::SelectFileDialog::FileTypeInfo info; | 1356 ui::SelectFileDialog::FileTypeInfo info; |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 extension_name = base::StringValue( | 1747 extension_name = base::StringValue( |
| 1753 extension ? extension->name() : std::string()); | 1748 extension ? extension->name() : std::string()); |
| 1754 web_ui()->CallJavascriptFunction( | 1749 web_ui()->CallJavascriptFunction( |
| 1755 "BrowserOptions.toggleStartupPagesControlled", | 1750 "BrowserOptions.toggleStartupPagesControlled", |
| 1756 extension_id, | 1751 extension_id, |
| 1757 extension_name); | 1752 extension_name); |
| 1758 } | 1753 } |
| 1759 #endif // defined(OS_WIN) | 1754 #endif // defined(OS_WIN) |
| 1760 | 1755 |
| 1761 } // namespace options | 1756 } // namespace options |
| OLD | NEW |