| 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 "sync/internal_api/js_sync_manager_observer.h" | 5 #include "sync/internal_api/js_sync_manager_observer.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 HandleJsEvent(FROM_HERE, "onInitializationComplete", JsEventDetails()); | 135 HandleJsEvent(FROM_HERE, "onInitializationComplete", JsEventDetails()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void JsSyncManagerObserver::OnStopSyncingPermanently() { | 138 void JsSyncManagerObserver::OnStopSyncingPermanently() { |
| 139 if (!event_handler_.IsInitialized()) { | 139 if (!event_handler_.IsInitialized()) { |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 HandleJsEvent(FROM_HERE, "onStopSyncingPermanently", JsEventDetails()); | 142 HandleJsEvent(FROM_HERE, "onStopSyncingPermanently", JsEventDetails()); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void JsSyncManagerObserver::OnClearServerDataSucceeded() { | |
| 146 if (!event_handler_.IsInitialized()) { | |
| 147 return; | |
| 148 } | |
| 149 HandleJsEvent(FROM_HERE, "onClearServerDataSucceeded", JsEventDetails()); | |
| 150 } | |
| 151 | |
| 152 void JsSyncManagerObserver::OnClearServerDataFailed() { | |
| 153 if (!event_handler_.IsInitialized()) { | |
| 154 return; | |
| 155 } | |
| 156 HandleJsEvent(FROM_HERE, "onClearServerDataFailed", JsEventDetails()); | |
| 157 } | |
| 158 | |
| 159 void JsSyncManagerObserver::HandleJsEvent( | 145 void JsSyncManagerObserver::HandleJsEvent( |
| 160 const tracked_objects::Location& from_here, | 146 const tracked_objects::Location& from_here, |
| 161 const std::string& name, const JsEventDetails& details) { | 147 const std::string& name, const JsEventDetails& details) { |
| 162 if (!event_handler_.IsInitialized()) { | 148 if (!event_handler_.IsInitialized()) { |
| 163 NOTREACHED(); | 149 NOTREACHED(); |
| 164 return; | 150 return; |
| 165 } | 151 } |
| 166 event_handler_.Call(from_here, | 152 event_handler_.Call(from_here, |
| 167 &JsEventHandler::HandleJsEvent, name, details); | 153 &JsEventHandler::HandleJsEvent, name, details); |
| 168 } | 154 } |
| 169 | 155 |
| 170 } // namespace browser_sync | 156 } // namespace browser_sync |
| OLD | NEW |