| 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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 sync_ui_util::SYNC_ERROR; | 1294 sync_ui_util::SYNC_ERROR; |
| 1295 sync_status->SetString("statusText", status_label); | 1295 sync_status->SetString("statusText", status_label); |
| 1296 sync_status->SetString("actionLinkText", link_label); | 1296 sync_status->SetString("actionLinkText", link_label); |
| 1297 sync_status->SetBoolean("hasError", status_has_error); | 1297 sync_status->SetBoolean("hasError", status_has_error); |
| 1298 | 1298 |
| 1299 sync_status->SetBoolean("managed", service && service->IsManaged()); | 1299 sync_status->SetBoolean("managed", service && service->IsManaged()); |
| 1300 sync_status->SetBoolean("signedIn", | 1300 sync_status->SetBoolean("signedIn", |
| 1301 !signin->GetAuthenticatedUsername().empty()); | 1301 !signin->GetAuthenticatedUsername().empty()); |
| 1302 sync_status->SetBoolean("hasUnrecoverableError", | 1302 sync_status->SetBoolean("hasUnrecoverableError", |
| 1303 service && service->HasUnrecoverableError()); | 1303 service && service->HasUnrecoverableError()); |
| 1304 sync_status->SetBoolean( | |
| 1305 "autoLoginVisible", | |
| 1306 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && | |
| 1307 service && service->IsSyncEnabledAndLoggedIn() && | |
| 1308 service->IsOAuthRefreshTokenAvailable()); | |
| 1309 | 1304 |
| 1310 return sync_status.Pass(); | 1305 return sync_status.Pass(); |
| 1311 } | 1306 } |
| 1312 | 1307 |
| 1313 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1308 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
| 1314 const base::ListValue* args) { | 1309 const base::ListValue* args) { |
| 1315 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1310 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1316 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1311 select_folder_dialog_ = ui::SelectFileDialog::Create( |
| 1317 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1312 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
| 1318 ui::SelectFileDialog::FileTypeInfo info; | 1313 ui::SelectFileDialog::FileTypeInfo info; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 1711 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
| 1717 bool has_users = !Profile::FromWebUI(web_ui())-> | 1712 bool has_users = !Profile::FromWebUI(web_ui())-> |
| 1718 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); | 1713 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); |
| 1719 base::FundamentalValue has_users_value(has_users); | 1714 base::FundamentalValue has_users_value(has_users); |
| 1720 web_ui()->CallJavascriptFunction( | 1715 web_ui()->CallJavascriptFunction( |
| 1721 "BrowserOptions.updateManagesSupervisedUsers", | 1716 "BrowserOptions.updateManagesSupervisedUsers", |
| 1722 has_users_value); | 1717 has_users_value); |
| 1723 } | 1718 } |
| 1724 | 1719 |
| 1725 } // namespace options | 1720 } // namespace options |
| OLD | NEW |