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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 *label); | 299 *label); |
300 | 300 |
301 enabled.reset(Value::CreateBooleanValue(!managed)); | 301 enabled.reset(Value::CreateBooleanValue(!managed)); |
302 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkEnabled", | 302 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkEnabled", |
303 *enabled); | 303 *enabled); |
304 | 304 |
305 visible.reset(Value::CreateBooleanValue(status_has_error)); | 305 visible.reset(Value::CreateBooleanValue(status_has_error)); |
306 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatusErrorVisible", | 306 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatusErrorVisible", |
307 *visible); | 307 *visible); |
308 | 308 |
| 309 enabled.reset(Value::CreateBooleanValue( |
| 310 !service->unrecoverable_error_detected())); |
| 311 web_ui_->CallJavascriptFunction( |
| 312 "PersonalOptions.setCustomizeSyncButtonEnabled", |
| 313 *enabled); |
| 314 |
309 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin)) { | 315 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin)) { |
310 visible.reset(Value::CreateBooleanValue( | 316 visible.reset(Value::CreateBooleanValue( |
311 service->AreCredentialsAvailable())); | 317 service->AreCredentialsAvailable())); |
312 web_ui_->CallJavascriptFunction("PersonalOptions.setAutoLoginVisible", | 318 web_ui_->CallJavascriptFunction("PersonalOptions.setAutoLoginVisible", |
313 *visible); | 319 *visible); |
314 } | 320 } |
315 | 321 |
316 // Set profile creation text and button if multi-profiles switch is on. | 322 // Set profile creation text and button if multi-profiles switch is on. |
317 visible.reset(Value::CreateBooleanValue(multiprofile_)); | 323 visible.reset(Value::CreateBooleanValue(multiprofile_)); |
318 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesSectionVisible", | 324 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesSectionVisible", |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 profile_info_list.Append(profile_value); | 411 profile_info_list.Append(profile_value); |
406 } | 412 } |
407 | 413 |
408 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 414 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
409 profile_info_list); | 415 profile_info_list); |
410 } | 416 } |
411 | 417 |
412 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 418 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
413 ProfileManager::CreateMultiProfileAsync(); | 419 ProfileManager::CreateMultiProfileAsync(); |
414 } | 420 } |
OLD | NEW |