Chromium Code Reviews| Index: chrome/browser/sync/glue/synced_tab_delegate.cc |
| diff --git a/chrome/browser/sync/glue/synced_tab_delegate.cc b/chrome/browser/sync/glue/synced_tab_delegate.cc |
| index ba6f9f3dd69a4052f526fb281924e9248eae1dc6..aef3a2b4b00726a3cf33c82358318d1b354abf63 100644 |
| --- a/chrome/browser/sync/glue/synced_tab_delegate.cc |
| +++ b/chrome/browser/sync/glue/synced_tab_delegate.cc |
| @@ -4,7 +4,7 @@ |
| #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
| -#include "chrome/browser/sync/glue/synced_window_delegate.h" |
| +#include "base/logging.h" |
| #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| #include "chrome/common/url_constants.h" |
| #include "content/public/browser/navigation_entry.h" |
| @@ -14,6 +14,9 @@ using browser_sync::SyncedTabDelegate; |
| namespace browser_sync { |
| +SyncedTabDelegate::SyncedTabDelegate() {} |
| +SyncedTabDelegate::~SyncedTabDelegate() {} |
| + |
| content::NavigationEntry* SyncedTabDelegate::GetCurrentEntryMaybePending() |
| const { |
| return GetEntryAtIndexMaybePending(GetCurrentEntryIndex()); |
| @@ -25,7 +28,7 @@ content::NavigationEntry* SyncedTabDelegate::GetEntryAtIndexMaybePending( |
| } |
| bool SyncedTabDelegate::ShouldSync() const { |
| - if (GetSyncedWindowDelegate() == NULL) |
| + if (GetSyncedWindowDelegate() == nullptr) |
| return false; |
| // Is there a valid NavigationEntry? |
| @@ -58,8 +61,17 @@ bool SyncedTabDelegate::ShouldSync() const { |
| return found_valid_url; |
| } |
| +void SyncedTabDelegate::SetSyncedWindowGetter( |
| + scoped_ptr<SyncedWindowDelegatesGetter> getter) { |
| + synced_window_getter_.reset(getter.release()); |
| +} |
| + |
| const SyncedWindowDelegate* SyncedTabDelegate::GetSyncedWindowDelegate() const { |
| - return SyncedWindowDelegate::FindById(GetWindowId()); |
| + if (!synced_window_getter_) { |
| + NOTREACHED(); |
|
Nicolas Zea
2015/09/02 21:19:43
Generally you shouldn't NOTREACH for a case that y
maxbogue
2015/09/02 23:05:40
Ah, ok. It is invalid, so I've removed the return.
|
| + return nullptr; |
| + } |
| + return synced_window_getter_->FindById(GetWindowId()); |
| } |
| } // namespace browser_sync |