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/options/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 15 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 CheckBool(dictionary, "extensionsSynced", types.Has(syncer::EXTENSIONS)); | 137 CheckBool(dictionary, "extensionsSynced", types.Has(syncer::EXTENSIONS)); |
138 CheckBool(dictionary, "passwordsSynced", types.Has(syncer::PASSWORDS)); | 138 CheckBool(dictionary, "passwordsSynced", types.Has(syncer::PASSWORDS)); |
139 CheckBool(dictionary, "preferencesSynced", types.Has(syncer::PREFERENCES)); | 139 CheckBool(dictionary, "preferencesSynced", types.Has(syncer::PREFERENCES)); |
140 CheckBool(dictionary, "tabsSynced", types.Has(syncer::PROXY_TABS)); | 140 CheckBool(dictionary, "tabsSynced", types.Has(syncer::PROXY_TABS)); |
141 CheckBool(dictionary, "themesSynced", types.Has(syncer::THEMES)); | 141 CheckBool(dictionary, "themesSynced", types.Has(syncer::THEMES)); |
142 CheckBool(dictionary, "typedUrlsSynced", types.Has(syncer::TYPED_URLS)); | 142 CheckBool(dictionary, "typedUrlsSynced", types.Has(syncer::TYPED_URLS)); |
143 CheckBool(dictionary, "wifiCredentialsSynced", | 143 CheckBool(dictionary, "wifiCredentialsSynced", |
144 types.Has(syncer::WIFI_CREDENTIALS)); | 144 types.Has(syncer::WIFI_CREDENTIALS)); |
145 } | 145 } |
146 | 146 |
147 | |
148 } // namespace | 147 } // namespace |
149 | 148 |
150 class TestingSyncSetupHandler : public SyncSetupHandler { | 149 class TestingSyncSetupHandler : public SyncSetupHandler { |
151 public: | 150 public: |
152 TestingSyncSetupHandler(content::WebUI* web_ui, Profile* profile) | 151 TestingSyncSetupHandler(content::WebUI* web_ui, Profile* profile) |
153 : profile_(profile) { | 152 : SyncSetupHandler(web_ui), profile_(profile) {} |
154 set_web_ui(web_ui); | 153 ~TestingSyncSetupHandler() override { set_web_ui(nullptr); } |
155 } | |
156 ~TestingSyncSetupHandler() override { set_web_ui(NULL); } | |
Dan Beam
2015/10/29 01:47:20
do we know why this was necessary?
tommycli
2015/10/29 17:34:14
Yeah, this is necessary because of: https://code.g
| |
157 | 154 |
158 void FocusUI() override {} | 155 void FocusUI() override {} |
159 | 156 |
160 Profile* GetProfile() const override { return profile_; } | 157 Profile* GetProfile() const override { return profile_; } |
161 | 158 |
162 using SyncSetupHandler::is_configuring_sync; | 159 using SyncSetupHandler::is_configuring_sync; |
163 | 160 |
164 private: | 161 private: |
165 #if !defined(OS_CHROMEOS) | 162 #if !defined(OS_CHROMEOS) |
166 void DisplayGaiaLoginInNewTabOrWindow() override {} | 163 void DisplayGaiaLoginInNewTabOrWindow() override {} |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
985 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) | 982 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) |
986 .WillRepeatedly(Return(false)); | 983 .WillRepeatedly(Return(false)); |
987 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 984 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
988 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); | 985 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); |
989 handler_->HandleConfigure(&list_args); | 986 handler_->HandleConfigure(&list_args); |
990 | 987 |
991 // Ensure that we navigated to the "done" state since we don't need a | 988 // Ensure that we navigated to the "done" state since we don't need a |
992 // passphrase. | 989 // passphrase. |
993 ExpectDone(); | 990 ExpectDone(); |
994 } | 991 } |
995 | |
OLD | NEW |