| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | |
| 6 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | |
| 7 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | |
| 8 | |
| 9 // This should be the version of ImplFromWebContents that's pulled in for non- | |
| 10 // android/ios builds. This is the standard content::WebContentsUserData way. | |
| 11 // SyncedTabDelegateAndroid is a little bit funky, and does this differently. | |
| 12 // Since SyncedTabDelegateAndroid implements most of its functionality by | |
| 13 // invoking TabContentsSyncedTabDelegate, this is the only SyncedTabDelegate | |
| 14 // piece that avoids being included in android builds. | |
| 15 | |
| 16 namespace browser_sync { | |
| 17 | |
| 18 // static | |
| 19 SyncedTabDelegate* SyncedTabDelegate::ImplFromWebContents( | |
| 20 content::WebContents* web_contents) { | |
| 21 SyncedTabDelegate* delegate = | |
| 22 TabContentsSyncedTabDelegate::FromWebContents(web_contents); | |
| 23 if (!delegate) { | |
| 24 return nullptr; | |
| 25 } | |
| 26 delegate->SetSyncedWindowGetter(make_scoped_ptr( | |
| 27 new BrowserSyncedWindowDelegatesGetter())); | |
| 28 return delegate; | |
| 29 } | |
| 30 | |
| 31 } // namespace browser_sync | |
| OLD | NEW |