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

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: Fix Android compile. Created 5 years, 4 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..073a7e36e2910f91262f129461a240355e124419 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());
@@ -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();
+ return NULL;
+ }
+ return synced_window_getter_->FindById(GetWindowId());
}
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698