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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_api.cc

Issue 74653002: sync: Add --enable-sync-sessions-v2 and necessary plumbing to use SessionsSyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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/extensions/api/sessions/sessions_api.cc
diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc
index cf0a759b9b873096d34a9d6e5f3b9937f0ee5990..96094d74250c2a42f08f7b2fc125a9cec7891325 100644
--- a/chrome/browser/extensions/api/sessions/sessions_api.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_api.cc
@@ -25,8 +25,8 @@
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/sessions/tab_restore_service_delegate.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
-#include "chrome/browser/sync/glue/session_model_associator.h"
#include "chrome/browser/sync/glue/synced_session.h"
+#include "chrome/browser/sync/open_tabs_ui_delegate.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -359,10 +359,10 @@ bool SessionsGetDevicesFunction::RunImpl() {
return true;
}
- browser_sync::SessionModelAssociator* associator =
- service->GetSessionModelAssociator();
+ browser_sync::OpenTabsUIDelegate* open_tabs =
+ service->GetOpenTabsUIDelegate();
std::vector<const browser_sync::SyncedSession*> sessions;
- if (!(associator && associator->GetAllForeignSessions(&sessions))) {
+ if (!(open_tabs && open_tabs->GetAllForeignSessions(&sessions))) {
results_ = GetDevices::Results::Create(
std::vector<linked_ptr<api::sessions::Device> >());
return true;
@@ -504,17 +504,17 @@ bool SessionsRestoreFunction::RestoreForeignSession(const SessionId& session_id,
SetError(kSessionSyncError);
return false;
}
- browser_sync::SessionModelAssociator* associator =
- service->GetSessionModelAssociator();
- if (!associator) {
+ browser_sync::OpenTabsUIDelegate* open_tabs =
+ service->GetOpenTabsUIDelegate();
+ if (!open_tabs) {
SetError(kSessionSyncError);
return false;
}
const SessionTab* tab = NULL;
- if (associator->GetForeignTab(session_id.session_tag(),
- session_id.id(),
- &tab)) {
+ if (open_tabs->GetForeignTab(session_id.session_tag(),
+ session_id.id(),
+ &tab)) {
TabStripModel* tab_strip = browser->tab_strip_model();
content::WebContents* contents = tab_strip->GetActiveWebContents();
@@ -527,7 +527,7 @@ bool SessionsRestoreFunction::RestoreForeignSession(const SessionId& session_id,
// Restoring a full window.
std::vector<const SessionWindow*> windows;
- if (!associator->GetForeignSession(session_id.session_tag(), &windows)) {
+ if (!open_tabs->GetForeignSession(session_id.session_tag(), &windows)) {
SetInvalidIdError(session_id.ToString());
return false;
}
« no previous file with comments | « chrome/browser/android/foreign_session_helper.cc ('k') | chrome/browser/extensions/api/sessions/sessions_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698