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

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

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 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 | « ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.h ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_hand ler.h" 5 #include "ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_hand ler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 void SyncInternalsMessageHandler::OnReceivedAllNodes( 152 void SyncInternalsMessageHandler::OnReceivedAllNodes(
153 int request_id, 153 int request_id,
154 std::unique_ptr<base::ListValue> nodes) { 154 std::unique_ptr<base::ListValue> nodes) {
155 base::FundamentalValue id(request_id); 155 base::FundamentalValue id(request_id);
156 web_ui()->CallJavascriptFunction(syncer::sync_ui_util::kGetAllNodesCallback, 156 web_ui()->CallJavascriptFunction(syncer::sync_ui_util::kGetAllNodesCallback,
157 id, *nodes); 157 id, *nodes);
158 } 158 }
159 159
160 void SyncInternalsMessageHandler::OnStateChanged() { 160 void SyncInternalsMessageHandler::OnStateChanged(syncer::SyncService* sync) {
161 SendAboutInfo(); 161 SendAboutInfo();
162 } 162 }
163 163
164 void SyncInternalsMessageHandler::OnProtocolEvent( 164 void SyncInternalsMessageHandler::OnProtocolEvent(
165 const syncer::ProtocolEvent& event) { 165 const syncer::ProtocolEvent& event) {
166 std::unique_ptr<base::DictionaryValue> value( 166 std::unique_ptr<base::DictionaryValue> value(
167 syncer::ProtocolEvent::ToValue(event)); 167 syncer::ProtocolEvent::ToValue(event));
168 web_ui()->CallJavascriptFunction( 168 web_ui()->CallJavascriptFunction(
169 syncer::sync_ui_util::kDispatchEvent, 169 syncer::sync_ui_util::kDispatchEvent,
170 base::StringValue(syncer::sync_ui_util::kOnProtocolEvent), *value); 170 base::StringValue(syncer::sync_ui_util::kOnProtocolEvent), *value);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 base::StringValue(syncer::sync_ui_util::kOnAboutInfoUpdated), *value); 223 base::StringValue(syncer::sync_ui_util::kOnAboutInfoUpdated), *value);
224 } 224 }
225 225
226 // Gets the SyncService of the underlying original profile. May return null. 226 // Gets the SyncService of the underlying original profile. May return null.
227 syncer::SyncService* SyncInternalsMessageHandler::GetSyncService() { 227 syncer::SyncService* SyncInternalsMessageHandler::GetSyncService() {
228 ios::ChromeBrowserState* browser_state = 228 ios::ChromeBrowserState* browser_state =
229 ios::ChromeBrowserState::FromWebUIIOS(web_ui()); 229 ios::ChromeBrowserState::FromWebUIIOS(web_ui());
230 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( 230 return IOSChromeProfileSyncServiceFactory::GetForBrowserState(
231 browser_state->GetOriginalChromeBrowserState()); 231 browser_state->GetOriginalChromeBrowserState());
232 } 232 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698