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

Unified Diff: chrome/browser/sync/glue/synced_tab_delegate.cc

Issue 1310373009: [Sync] Remove static methods on SyncedWindowDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
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..2f9c6832a21cf6286565dfaf2170a788e1a3d533 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,16 @@ 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();
+ }
+ return synced_window_getter_->FindById(GetWindowId());
}
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/synced_tab_delegate.h ('k') | chrome/browser/sync/glue/synced_tab_delegate_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698