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

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

Issue 1310373009: [Sync] Remove static methods on SyncedWindowDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build. 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_android.cc
diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.cc b/chrome/browser/sync/glue/synced_tab_delegate_android.cc
index 8173dfbba0da516fab9a53583d80217945893943..5629a71f177c01ac6ddcaa1f134f3c1f54e986c7 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate_android.cc
+++ b/chrome/browser/sync/glue/synced_tab_delegate_android.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/synced_window_delegate.h"
+#include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
#include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
@@ -118,7 +119,13 @@ void SyncedTabDelegateAndroid::SetSyncId(int sync_id) {
SyncedTabDelegate* SyncedTabDelegate::ImplFromWebContents(
content::WebContents* web_contents) {
TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
- return tab ? tab->GetSyncedTabDelegate() : NULL;
+ if (!tab) {
+ return NULL;
Nicolas Zea 2015/09/02 21:19:44 nit: style guide recommends nullptr for all new co
maxbogue 2015/09/02 23:05:40 Done.
+ }
+ SyncedTabDelegate* delegate = tab->GetSyncedTabDelegate();
Nicolas Zea 2015/09/02 21:19:43 Can delegate be null? Should that be handled?
maxbogue 2015/09/02 23:05:40 Yes, thank you. I forgot there were two versions o
+ delegate->SetSyncedWindowGetter(make_scoped_ptr(
+ new SyncedWindowDelegatesGetterAndroid()));
+ return delegate;
}
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698