| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_internals_message_handler.h" | 5 #include "chrome/browser/ui/webui/sync_internals_message_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 sync_driver::SyncService* service, | 36 sync_driver::SyncService* service, |
| 37 SigninManagerBase* signin) override { | 37 SigninManagerBase* signin) override { |
| 38 return sync_driver::sync_ui_util::ConstructAboutInformation( | 38 return sync_driver::sync_ui_util::ConstructAboutInformation( |
| 39 service, signin, chrome::GetChannel()); | 39 service, signin, chrome::GetChannel()); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 SyncInternalsMessageHandler::SyncInternalsMessageHandler() | 44 SyncInternalsMessageHandler::SyncInternalsMessageHandler() |
| 45 : SyncInternalsMessageHandler( | 45 : SyncInternalsMessageHandler( |
| 46 base::WrapUnique(new UtilAboutSyncDataExtractor())) {} | 46 base::MakeUnique<UtilAboutSyncDataExtractor>()) {} |
| 47 | 47 |
| 48 SyncInternalsMessageHandler::SyncInternalsMessageHandler( | 48 SyncInternalsMessageHandler::SyncInternalsMessageHandler( |
| 49 std::unique_ptr<AboutSyncDataExtractor> about_sync_data_extractor) | 49 std::unique_ptr<AboutSyncDataExtractor> about_sync_data_extractor) |
| 50 : about_sync_data_extractor_(std::move(about_sync_data_extractor)), | 50 : about_sync_data_extractor_(std::move(about_sync_data_extractor)), |
| 51 weak_ptr_factory_(this) {} | 51 weak_ptr_factory_(this) {} |
| 52 | 52 |
| 53 SyncInternalsMessageHandler::~SyncInternalsMessageHandler() { | 53 SyncInternalsMessageHandler::~SyncInternalsMessageHandler() { |
| 54 if (js_controller_) | 54 if (js_controller_) |
| 55 js_controller_->RemoveJsEventHandler(this); | 55 js_controller_->RemoveJsEventHandler(this); |
| 56 | 56 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 *value); | 244 *value); |
| 245 } | 245 } |
| 246 | 246 |
| 247 // Gets the ProfileSyncService of the underlying original profile. | 247 // Gets the ProfileSyncService of the underlying original profile. |
| 248 // May return NULL (e.g., if sync is disabled on the command line). | 248 // May return NULL (e.g., if sync is disabled on the command line). |
| 249 ProfileSyncService* SyncInternalsMessageHandler::GetProfileSyncService() { | 249 ProfileSyncService* SyncInternalsMessageHandler::GetProfileSyncService() { |
| 250 Profile* profile = Profile::FromWebUI(web_ui()); | 250 Profile* profile = Profile::FromWebUI(web_ui()); |
| 251 return ProfileSyncServiceFactory::GetForProfile( | 251 return ProfileSyncServiceFactory::GetForProfile( |
| 252 profile->GetOriginalProfile()); | 252 profile->GetOriginalProfile()); |
| 253 } | 253 } |
| OLD | NEW |