| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/sync/tab_contents_synced_tab_delegate.h" | 5 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sessions/session_tab_helper.h" | 9 #include "chrome/browser/sessions/session_tab_helper.h" |
| 10 #include "chrome/browser/sync/sessions/sync_sessions_router_tab_helper.h" | 10 #include "chrome/browser/sync/sessions/sync_sessions_router_tab_helper.h" |
| 11 #include "chrome/common/features.h" | 11 #include "chrome/common/features.h" |
| 12 #include "components/sessions/content/content_serialized_navigation_builder.h" | 12 #include "components/sessions/content/content_serialized_navigation_builder.h" |
| 13 #include "components/sync_sessions/sync_sessions_client.h" | 13 #include "components/sync_sessions/sync_sessions_client.h" |
| 14 #include "components/sync_sessions/synced_window_delegate.h" | 14 #include "components/sync_sessions/synced_window_delegate.h" |
| 15 #include "components/sync_sessions/synced_window_delegates_getter.h" | 15 #include "components/sync_sessions/synced_window_delegates_getter.h" |
| 16 #include "components/sync_sessions/tab_node_pool.h" |
| 16 #include "content/public/browser/favicon_status.h" | 17 #include "content/public/browser/favicon_status.h" |
| 17 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
| 18 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 19 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 20 #include "extensions/features/features.h" | 21 #include "extensions/features/features.h" |
| 21 | 22 |
| 22 #if BUILDFLAG(ENABLE_EXTENSIONS) | 23 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 23 #include "chrome/browser/extensions/tab_helper.h" | 24 #include "chrome/browser/extensions/tab_helper.h" |
| 24 #include "extensions/common/extension.h" | 25 #include "extensions/common/extension.h" |
| 25 #endif | 26 #endif |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 int pending_index = web_contents->GetController().GetPendingEntryIndex(); | 42 int pending_index = web_contents->GetController().GetPendingEntryIndex(); |
| 42 return (pending_index == i) | 43 return (pending_index == i) |
| 43 ? web_contents->GetController().GetPendingEntry() | 44 ? web_contents->GetController().GetPendingEntry() |
| 44 : web_contents->GetController().GetEntryAtIndex(i); | 45 : web_contents->GetController().GetEntryAtIndex(i); |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace | 48 } // namespace |
| 48 | 49 |
| 49 TabContentsSyncedTabDelegate::TabContentsSyncedTabDelegate( | 50 TabContentsSyncedTabDelegate::TabContentsSyncedTabDelegate( |
| 50 content::WebContents* web_contents) | 51 content::WebContents* web_contents) |
| 51 : web_contents_(web_contents), sync_session_id_(0) {} | 52 : web_contents_(web_contents), |
| 53 sync_session_id_(sync_sessions::TabNodePool::kInvalidTabNodeID) {} |
| 52 | 54 |
| 53 TabContentsSyncedTabDelegate::~TabContentsSyncedTabDelegate() {} | 55 TabContentsSyncedTabDelegate::~TabContentsSyncedTabDelegate() {} |
| 54 | 56 |
| 55 SessionID::id_type TabContentsSyncedTabDelegate::GetWindowId() const { | 57 SessionID::id_type TabContentsSyncedTabDelegate::GetWindowId() const { |
| 56 return SessionTabHelper::FromWebContents(web_contents_)->window_id().id(); | 58 return SessionTabHelper::FromWebContents(web_contents_)->window_id().id(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 SessionID::id_type TabContentsSyncedTabDelegate::GetSessionId() const { | 61 SessionID::id_type TabContentsSyncedTabDelegate::GetSessionId() const { |
| 60 return SessionTabHelper::FromWebContents(web_contents_)->session_id().id(); | 62 return SessionTabHelper::FromWebContents(web_contents_)->session_id().id(); |
| 61 } | 63 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 174 } |
| 173 return false; | 175 return false; |
| 174 } | 176 } |
| 175 | 177 |
| 176 SessionID::id_type TabContentsSyncedTabDelegate::GetSourceTabID() const { | 178 SessionID::id_type TabContentsSyncedTabDelegate::GetSourceTabID() const { |
| 177 sync_sessions::SyncSessionsRouterTabHelper* helper = | 179 sync_sessions::SyncSessionsRouterTabHelper* helper = |
| 178 sync_sessions::SyncSessionsRouterTabHelper::FromWebContents( | 180 sync_sessions::SyncSessionsRouterTabHelper::FromWebContents( |
| 179 web_contents_); | 181 web_contents_); |
| 180 return helper->source_tab_id(); | 182 return helper->source_tab_id(); |
| 181 } | 183 } |
| OLD | NEW |