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/ui/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 "preferences", | 87 "preferences", |
88 "passwords", | 88 "passwords", |
89 "autofill", | 89 "autofill", |
90 "themes", | 90 "themes", |
91 "typedUrls", | 91 "typedUrls", |
92 "extensions", | 92 "extensions", |
93 "apps", | 93 "apps", |
94 "tabs" | 94 "tabs" |
95 }; | 95 }; |
96 | 96 |
97 COMPILE_ASSERT(27 == syncer::MODEL_TYPE_COUNT, | 97 COMPILE_ASSERT(28 == syncer::MODEL_TYPE_COUNT, |
98 update_kDataTypeNames_to_match_UserSelectableTypes); | 98 update_kDataTypeNames_to_match_UserSelectableTypes); |
99 | 99 |
100 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; | 100 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; |
101 | 101 |
102 ModelTypeNameMap GetSelectableTypeNameMap() { | 102 ModelTypeNameMap GetSelectableTypeNameMap() { |
103 ModelTypeNameMap type_names; | 103 ModelTypeNameMap type_names; |
104 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); | 104 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); |
105 syncer::ModelTypeSet::Iterator it = type_set.First(); | 105 syncer::ModelTypeSet::Iterator it = type_set.First(); |
106 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size()); | 106 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size()); |
107 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good(); | 107 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good(); |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 1373 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
1374 } | 1374 } |
1375 | 1375 |
1376 void SyncSetupHandler::CloseOverlay() { | 1376 void SyncSetupHandler::CloseOverlay() { |
1377 // Stop a timer to handle timeout in waiting for sync setup. | 1377 // Stop a timer to handle timeout in waiting for sync setup. |
1378 backend_start_timer_.reset(); | 1378 backend_start_timer_.reset(); |
1379 | 1379 |
1380 CloseSyncSetup(); | 1380 CloseSyncSetup(); |
1381 web_ui()->CallJavascriptFunction("OptionsPage.closeOverlay"); | 1381 web_ui()->CallJavascriptFunction("OptionsPage.closeOverlay"); |
1382 } | 1382 } |
OLD | NEW |