OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/personal_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/personal_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 *label); | 302 *label); |
303 | 303 |
304 enabled.reset(Value::CreateBooleanValue(!managed)); | 304 enabled.reset(Value::CreateBooleanValue(!managed)); |
305 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkEnabled", | 305 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkEnabled", |
306 *enabled); | 306 *enabled); |
307 | 307 |
308 visible.reset(Value::CreateBooleanValue(status_has_error)); | 308 visible.reset(Value::CreateBooleanValue(status_has_error)); |
309 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatusErrorVisible", | 309 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatusErrorVisible", |
310 *visible); | 310 *visible); |
311 | 311 |
| 312 enabled.reset(Value::CreateBooleanValue( |
| 313 !service->unrecoverable_error_detected())); |
| 314 web_ui_->CallJavascriptFunction( |
| 315 "PersonalOptions.setCustomizeSyncButtonEnabled", |
| 316 *enabled); |
| 317 |
312 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin)) { | 318 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin)) { |
313 visible.reset(Value::CreateBooleanValue( | 319 visible.reset(Value::CreateBooleanValue( |
314 service->AreCredentialsAvailable())); | 320 service->AreCredentialsAvailable())); |
315 web_ui_->CallJavascriptFunction("PersonalOptions.setAutoLoginVisible", | 321 web_ui_->CallJavascriptFunction("PersonalOptions.setAutoLoginVisible", |
316 *visible); | 322 *visible); |
317 } | 323 } |
318 | 324 |
319 // Set profile creation text and button if multi-profiles switch is on. | 325 // Set profile creation text and button if multi-profiles switch is on. |
320 visible.reset(Value::CreateBooleanValue(multiprofile_)); | 326 visible.reset(Value::CreateBooleanValue(multiprofile_)); |
321 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesSectionVisible", | 327 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesSectionVisible", |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 profile_info_list.Append(profile_value); | 414 profile_info_list.Append(profile_value); |
409 } | 415 } |
410 | 416 |
411 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 417 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
412 profile_info_list); | 418 profile_info_list); |
413 } | 419 } |
414 | 420 |
415 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 421 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
416 ProfileManager::CreateMultiProfileAsync(); | 422 ProfileManager::CreateMultiProfileAsync(); |
417 } | 423 } |
OLD | NEW |