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/options/sync_setup_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SyncConfigInfo::SyncConfigInfo() | 87 SyncConfigInfo::SyncConfigInfo() |
88 : encrypt_all(false), | 88 : encrypt_all(false), |
89 sync_everything(false), | 89 sync_everything(false), |
90 sync_nothing(false), | 90 sync_nothing(false), |
91 payments_integration_enabled(false), | 91 payments_integration_enabled(false), |
92 passphrase_is_gaia(false) {} | 92 passphrase_is_gaia(false) {} |
93 | 93 |
94 SyncConfigInfo::~SyncConfigInfo() {} | 94 SyncConfigInfo::~SyncConfigInfo() {} |
95 | 95 |
96 bool GetConfiguration(const std::string& json, SyncConfigInfo* config) { | 96 bool GetConfiguration(const std::string& json, SyncConfigInfo* config) { |
97 scoped_ptr<base::Value> parsed_value = base::JSONReader::Read(json); | 97 std::unique_ptr<base::Value> parsed_value = base::JSONReader::Read(json); |
98 base::DictionaryValue* result; | 98 base::DictionaryValue* result; |
99 if (!parsed_value || !parsed_value->GetAsDictionary(&result)) { | 99 if (!parsed_value || !parsed_value->GetAsDictionary(&result)) { |
100 DLOG(ERROR) << "GetConfiguration() not passed a Dictionary"; | 100 DLOG(ERROR) << "GetConfiguration() not passed a Dictionary"; |
101 return false; | 101 return false; |
102 } | 102 } |
103 | 103 |
104 if (!result->GetBoolean("syncAllDataTypes", &config->sync_everything)) { | 104 if (!result->GetBoolean("syncAllDataTypes", &config->sync_everything)) { |
105 DLOG(ERROR) << "GetConfiguration() not passed a syncAllDataTypes value"; | 105 DLOG(ERROR) << "GetConfiguration() not passed a syncAllDataTypes value"; |
106 return false; | 106 return false; |
107 } | 107 } |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 "SyncSetupOverlay.showSyncSetupPage", page, args); | 957 "SyncSetupOverlay.showSyncSetupPage", page, args); |
958 | 958 |
959 // Make sure the tab used for the Gaia sign in does not cover the settings | 959 // Make sure the tab used for the Gaia sign in does not cover the settings |
960 // tab. | 960 // tab. |
961 FocusUI(); | 961 FocusUI(); |
962 } | 962 } |
963 | 963 |
964 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 964 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
965 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 965 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
966 } | 966 } |
OLD | NEW |