Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: chrome/browser/ui/webui/sync_internals_message_handler.cc

Issue 2948603002: [Sync] Get SyncServce instead of ProfileSyncService. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 DispatchEvent(name, details.Get()); 277 DispatchEvent(name, details.Get());
278 } 278 }
279 279
280 void SyncInternalsMessageHandler::SendAboutInfo() { 280 void SyncInternalsMessageHandler::SendAboutInfo() {
281 std::unique_ptr<DictionaryValue> value = 281 std::unique_ptr<DictionaryValue> value =
282 about_sync_data_delegate_.Run(GetSyncService(), chrome::GetChannel()); 282 about_sync_data_delegate_.Run(GetSyncService(), chrome::GetChannel());
283 DispatchEvent(syncer::sync_ui_util::kOnAboutInfoUpdated, *value); 283 DispatchEvent(syncer::sync_ui_util::kOnAboutInfoUpdated, *value);
284 } 284 }
285 285
286 SyncService* SyncInternalsMessageHandler::GetSyncService() { 286 SyncService* SyncInternalsMessageHandler::GetSyncService() {
287 return ProfileSyncServiceFactory::GetForProfile( 287 return ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
288 Profile::FromWebUI(web_ui())->GetOriginalProfile()); 288 Profile::FromWebUI(web_ui())->GetOriginalProfile());
289 } 289 }
290 290
291 void SyncInternalsMessageHandler::DispatchEvent(const std::string& name, 291 void SyncInternalsMessageHandler::DispatchEvent(const std::string& name,
292 const Value& details_value) { 292 const Value& details_value) {
293 CallJavascriptFunction(syncer::sync_ui_util::kDispatchEvent, Value(name), 293 CallJavascriptFunction(syncer::sync_ui_util::kDispatchEvent, Value(name),
294 details_value); 294 details_value);
295 } 295 }
296 296
297 void SyncInternalsMessageHandler::UnregisterModelNotifications() { 297 void SyncInternalsMessageHandler::UnregisterModelNotifications() {
(...skipping 10 matching lines...) Expand all
308 js_controller_->RemoveJsEventHandler(this); 308 js_controller_->RemoveJsEventHandler(this);
309 js_controller_ = nullptr; 309 js_controller_ = nullptr;
310 is_registered_ = false; 310 is_registered_ = false;
311 } 311 }
312 312
313 if (is_registered_for_counters_) { 313 if (is_registered_for_counters_) {
314 service->RemoveTypeDebugInfoObserver(this); 314 service->RemoveTypeDebugInfoObserver(this);
315 is_registered_for_counters_ = false; 315 is_registered_for_counters_ = false;
316 } 316 }
317 } 317 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698