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/options/sync_options_handler.h" | 5 #include "chrome/browser/dom_ui/options/sync_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/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 void SyncOptionsHandler::Initialize() { | 57 void SyncOptionsHandler::Initialize() { |
58 ProfileSyncService* service = | 58 ProfileSyncService* service = |
59 dom_ui_->GetProfile()->GetOriginalProfile()->GetProfileSyncService(); | 59 dom_ui_->GetProfile()->GetOriginalProfile()->GetProfileSyncService(); |
60 // If service is unavailable for some good reason, 'IsEnabled()' method | 60 // If service is unavailable for some good reason, 'IsEnabled()' method |
61 // should return false. Otherwise something is broken. | 61 // should return false. Otherwise something is broken. |
62 DCHECK(service); | 62 DCHECK(service); |
63 | 63 |
64 DictionaryValue args; | 64 DictionaryValue args; |
65 SyncSetupFlow::GetArgsForChooseDataTypes(service, &args); | 65 SyncSetupFlow::GetArgsForConfigure(service, &args); |
66 | 66 |
67 dom_ui_->CallJavascriptFunction(L"SyncOptions.setRegisteredDataTypes", args); | 67 dom_ui_->CallJavascriptFunction(L"SyncOptions.setRegisteredDataTypes", args); |
68 } | 68 } |
69 | 69 |
70 void SyncOptionsHandler::RegisterMessages() { | 70 void SyncOptionsHandler::RegisterMessages() { |
71 dom_ui_->RegisterMessageCallback("updatePreferredDataTypes", | 71 dom_ui_->RegisterMessageCallback("updatePreferredDataTypes", |
72 NewCallback(this, &SyncOptionsHandler::OnPreferredDataTypesUpdated)); | 72 NewCallback(this, &SyncOptionsHandler::OnPreferredDataTypesUpdated)); |
73 } | 73 } |
74 | 74 |
75 void SyncOptionsHandler::OnPreferredDataTypesUpdated(const ListValue* args) { | 75 void SyncOptionsHandler::OnPreferredDataTypesUpdated(const ListValue* args) { |
76 NotificationService::current()->Notify( | 76 NotificationService::current()->Notify( |
77 NotificationType::SYNC_DATA_TYPES_UPDATED, | 77 NotificationType::SYNC_DATA_TYPES_UPDATED, |
78 Source<Profile>(dom_ui_->GetProfile()), | 78 Source<Profile>(dom_ui_->GetProfile()), |
79 NotificationService::NoDetails()); | 79 NotificationService::NoDetails()); |
80 } | 80 } |
OLD | NEW |