| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/personal_options_handler.h" | 5 #include "chrome/browser/dom_ui/personal_options_handler.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 "getSyncStatus", | 96 "getSyncStatus", |
| 97 NewCallback(this,&PersonalOptionsHandler::SetSyncStatusUIString)); | 97 NewCallback(this,&PersonalOptionsHandler::SetSyncStatusUIString)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void PersonalOptionsHandler::SetSyncStatusUIString(const Value* value) { | 100 void PersonalOptionsHandler::SetSyncStatusUIString(const Value* value) { |
| 101 DCHECK(dom_ui_); | 101 DCHECK(dom_ui_); |
| 102 | 102 |
| 103 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService(); | 103 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService(); |
| 104 if(service != NULL && ProfileSyncService::IsSyncEnabled()) { | 104 if(service != NULL && ProfileSyncService::IsSyncEnabled()) { |
| 105 scoped_ptr<Value> status_string(Value::CreateStringValue( | 105 scoped_ptr<Value> status_string(Value::CreateStringValue( |
| 106 l10n_util::GetStringF(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, | 106 l10n_util::GetStringFUTF16(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, |
| 107 UTF16ToWide(service->GetAuthenticatedUsername()), | 107 service->GetAuthenticatedUsername(), |
| 108 service->GetLastSyncedTimeString()))); | 108 service->GetLastSyncedTimeString()))); |
| 109 | 109 |
| 110 dom_ui_->CallJavascriptFunction( | 110 dom_ui_->CallJavascriptFunction( |
| 111 L"PersonalOptions.syncStatusCallback", | 111 L"PersonalOptions.syncStatusCallback", |
| 112 *(status_string.get())); | 112 *(status_string.get())); |
| 113 } | 113 } |
| 114 } | 114 } |
| OLD | NEW |