OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_setup_flow.h" | 5 #include "chrome/browser/sync/sync_setup_flow.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/signin/signin_manager.h" | 17 #include "chrome/browser/signin/signin_manager.h" |
18 #include "chrome/browser/sync/profile_sync_service.h" | 18 #include "chrome/browser/sync/profile_sync_service.h" |
19 #include "chrome/browser/sync/profile_sync_service_factory.h" | 19 #include "chrome/browser/sync/profile_sync_service_factory.h" |
20 #include "chrome/browser/sync/sync_setup_flow_handler.h" | 20 #include "chrome/browser/sync/sync_setup_flow_handler.h" |
21 #include "chrome/browser/sync/syncable/model_type.h" | |
22 #include "chrome/browser/sync/user_selectable_sync_type.h" | 21 #include "chrome/browser/sync/user_selectable_sync_type.h" |
23 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
24 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/net/gaia/gaia_constants.h" | 24 #include "chrome/common/net/gaia/gaia_constants.h" |
26 #include "chrome/common/net/gaia/google_service_auth_error.h" | 25 #include "chrome/common/net/gaia/google_service_auth_error.h" |
27 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
28 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
29 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 29 #include "sync/syncable/model_type.h" |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 // Helper function to disable password sync. | 33 // Helper function to disable password sync. |
34 void DisablePasswordSync(ProfileSyncService* service) { | 34 void DisablePasswordSync(ProfileSyncService* service) { |
35 syncable::ModelTypeSet types = service->GetPreferredDataTypes(); | 35 syncable::ModelTypeSet types = service->GetPreferredDataTypes(); |
36 types.Remove(syncable::PASSWORDS); | 36 types.Remove(syncable::PASSWORDS); |
37 service->OnUserChoseDatatypes(false, types); | 37 service->OnUserChoseDatatypes(false, types); |
38 } | 38 } |
39 | 39 |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 case SyncSetupWizard::DONE: | 497 case SyncSetupWizard::DONE: |
498 case SyncSetupWizard::ABORT: | 498 case SyncSetupWizard::ABORT: |
499 flow_handler_->ShowSetupDone(UTF8ToUTF16( | 499 flow_handler_->ShowSetupDone(UTF8ToUTF16( |
500 service_->profile()->GetPrefs()->GetString( | 500 service_->profile()->GetPrefs()->GetString( |
501 prefs::kGoogleServicesUsername))); | 501 prefs::kGoogleServicesUsername))); |
502 break; | 502 break; |
503 default: | 503 default: |
504 NOTREACHED() << "Invalid advance state: " << state; | 504 NOTREACHED() << "Invalid advance state: " << state; |
505 } | 505 } |
506 } | 506 } |
OLD | NEW |