| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync/internal_api/sync_manager.h" | 5 #include "chrome/browser/sync/internal_api/sync_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 return; | 1683 return; |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 if (event.what_happened == SyncEngineEvent::ACTIONABLE_ERROR) { | 1686 if (event.what_happened == SyncEngineEvent::ACTIONABLE_ERROR) { |
| 1687 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1687 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1688 OnActionableError( | 1688 OnActionableError( |
| 1689 event.snapshot->errors.sync_protocol_error)); | 1689 event.snapshot->errors.sync_protocol_error)); |
| 1690 return; | 1690 return; |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 if (event.what_happened == SyncEngineEvent::UNRECOVERABLE_ERROR) { |
| 1694 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1695 OnUnrecoverableError( |
| 1696 event.unrecoverable_error_info.location, |
| 1697 event.unrecoverable_error_info.message)); |
| 1698 return; |
| 1699 } |
| 1700 |
| 1693 } | 1701 } |
| 1694 | 1702 |
| 1695 void SyncManager::SyncInternal::SetJsEventHandler( | 1703 void SyncManager::SyncInternal::SetJsEventHandler( |
| 1696 const WeakHandle<JsEventHandler>& event_handler) { | 1704 const WeakHandle<JsEventHandler>& event_handler) { |
| 1697 js_event_handler_ = event_handler; | 1705 js_event_handler_ = event_handler; |
| 1698 js_sync_manager_observer_.SetJsEventHandler(js_event_handler_); | 1706 js_sync_manager_observer_.SetJsEventHandler(js_event_handler_); |
| 1699 js_mutation_event_observer_.SetJsEventHandler(js_event_handler_); | 1707 js_mutation_event_observer_.SetJsEventHandler(js_event_handler_); |
| 1700 } | 1708 } |
| 1701 | 1709 |
| 1702 void SyncManager::SyncInternal::ProcessJsMessage( | 1710 void SyncManager::SyncInternal::ProcessJsMessage( |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 | 2086 |
| 2079 for (syncable::ModelTypeSet::const_iterator i = types.begin(); | 2087 for (syncable::ModelTypeSet::const_iterator i = types.begin(); |
| 2080 i != types.end(); ++i) { | 2088 i != types.end(); ++i) { |
| 2081 if (!lookup->initial_sync_ended_for_type(*i)) | 2089 if (!lookup->initial_sync_ended_for_type(*i)) |
| 2082 return false; | 2090 return false; |
| 2083 } | 2091 } |
| 2084 return true; | 2092 return true; |
| 2085 } | 2093 } |
| 2086 | 2094 |
| 2087 } // namespace sync_api | 2095 } // namespace sync_api |
| OLD | NEW |