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/sync/sync_ui_util.h" | 5 #include "chrome/browser/sync/sync_ui_util.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 Profile* profile, ProfileSyncService::SyncEventCodes code) { | 181 Profile* profile, ProfileSyncService::SyncEventCodes code) { |
182 ProfileSyncService* service = | 182 ProfileSyncService* service = |
183 profile->GetOriginalProfile()->GetProfileSyncService(); | 183 profile->GetOriginalProfile()->GetProfileSyncService(); |
184 if (!service || !service->IsSyncEnabled()) { | 184 if (!service || !service->IsSyncEnabled()) { |
185 LOG(DFATAL) << "OpenSyncMyBookmarksDialog called with sync disabled"; | 185 LOG(DFATAL) << "OpenSyncMyBookmarksDialog called with sync disabled"; |
186 return; | 186 return; |
187 } | 187 } |
188 if (service->HasSyncSetupCompleted()) { | 188 if (service->HasSyncSetupCompleted()) { |
189 ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, profile); | 189 ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, profile); |
190 } else { | 190 } else { |
191 service->EnableForUser(NULL); | 191 service->ShowLoginDialog(NULL); |
192 ProfileSyncService::SyncEvent(code); | 192 ProfileSyncService::SyncEvent(code); // UMA stats |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 } // namespace sync_ui_util | 196 } // namespace sync_ui_util |
OLD | NEW |