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

Side by Side Diff: chrome/browser/sync/glue/synced_tab_delegate_desktop.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/synced_tab_delegate.h" 5 #include "chrome/browser/sync/glue/synced_tab_delegate.h"
6 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h"
6 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" 7 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
7 8
8 // This should be the version of ImplFromWebContents that's pulled in for non- 9 // This should be the version of ImplFromWebContents that's pulled in for non-
9 // android/ios builds. This is the standard content::WebContentsUserData way. 10 // android/ios builds. This is the standard content::WebContentsUserData way.
10 // SyncedTabDelegateAndroid is a little bit funky, and does this differently. 11 // SyncedTabDelegateAndroid is a little bit funky, and does this differently.
11 // Since SyncedTabDelegateAndroid implements most of its functionality by 12 // Since SyncedTabDelegateAndroid implements most of its functionality by
12 // invoking TabContentsSyncedTabDelegate, this is the only SyncedTabDelegate 13 // invoking TabContentsSyncedTabDelegate, this is the only SyncedTabDelegate
13 // piece that avoids being included in android builds. 14 // piece that avoids being included in android builds.
14 15
15 namespace browser_sync { 16 namespace browser_sync {
16 17
17 // static 18 // static
18 SyncedTabDelegate* SyncedTabDelegate::ImplFromWebContents( 19 SyncedTabDelegate* SyncedTabDelegate::ImplFromWebContents(
19 content::WebContents* web_contents) { 20 content::WebContents* web_contents) {
20 return TabContentsSyncedTabDelegate::FromWebContents(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;
21 } 29 }
22 30
23 } // namespace browser_sync 31 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/synced_tab_delegate_android.cc ('k') | chrome/browser/sync/glue/synced_window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698