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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 "requestUpdatedAboutInfo", | 54 "requestUpdatedAboutInfo", |
55 base::Bind(&SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo, | 55 base::Bind(&SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo, |
56 base::Unretained(this))); | 56 base::Unretained(this))); |
57 | 57 |
58 web_ui()->RegisterMessageCallback( | 58 web_ui()->RegisterMessageCallback( |
59 "requestListOfTypes", | 59 "requestListOfTypes", |
60 base::Bind(&SyncInternalsMessageHandler::HandleRequestListOfTypes, | 60 base::Bind(&SyncInternalsMessageHandler::HandleRequestListOfTypes, |
61 base::Unretained(this))); | 61 base::Unretained(this))); |
62 | 62 |
63 RegisterJsControllerCallback("getAllNodes"); | 63 RegisterJsControllerCallback("getAllNodes"); |
64 RegisterJsControllerCallback("getClientServerTraffic"); | |
65 } | 64 } |
66 | 65 |
67 void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo( | 66 void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo( |
68 const base::ListValue* args) { | 67 const base::ListValue* args) { |
69 DCHECK(args->empty()); | 68 DCHECK(args->empty()); |
70 SendAboutInfo(); | 69 SendAboutInfo(); |
71 } | 70 } |
72 | 71 |
73 void SyncInternalsMessageHandler::HandleRequestListOfTypes( | 72 void SyncInternalsMessageHandler::HandleRequestListOfTypes( |
74 const base::ListValue* args) { | 73 const base::ListValue* args) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 153 } |
155 | 154 |
156 // Gets the ProfileSyncService of the underlying original profile. | 155 // Gets the ProfileSyncService of the underlying original profile. |
157 // May return NULL (e.g., if sync is disabled on the command line). | 156 // May return NULL (e.g., if sync is disabled on the command line). |
158 ProfileSyncService* SyncInternalsMessageHandler::GetProfileSyncService() { | 157 ProfileSyncService* SyncInternalsMessageHandler::GetProfileSyncService() { |
159 Profile* profile = Profile::FromWebUI(web_ui()); | 158 Profile* profile = Profile::FromWebUI(web_ui()); |
160 ProfileSyncServiceFactory* factory = ProfileSyncServiceFactory::GetInstance(); | 159 ProfileSyncServiceFactory* factory = ProfileSyncServiceFactory::GetInstance(); |
161 return factory->GetForProfile(profile->GetOriginalProfile()); | 160 return factory->GetForProfile(profile->GetOriginalProfile()); |
162 } | 161 } |
163 | 162 |
OLD | NEW |