Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 1 | // Copyright 2018 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/ui/sync/browser_synced_tab_delegate.h" |
| 6 | |
Mikel Astiz | 3308e2e3 | 2018-06-19 19:08:42 | [diff] [blame] | 7 | #include "chrome/browser/sync/sessions/sync_sessions_router_tab_helper.h" |
Scott Violet | 5655874f | 2020-01-14 21:03:21 | [diff] [blame] | 8 | #include "components/sessions/content/session_tab_helper.h" |
Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 9 | |
Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 10 | BrowserSyncedTabDelegate::BrowserSyncedTabDelegate( |
Dave Tapuska | eeb6879 | 2021-11-16 21:38:40 | [diff] [blame^] | 11 | content::WebContents* web_contents) |
| 12 | : content::WebContentsUserData<BrowserSyncedTabDelegate>(*web_contents) { |
Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 13 | SetWebContents(web_contents); |
| 14 | } |
| 15 | |
| 16 | BrowserSyncedTabDelegate::~BrowserSyncedTabDelegate() {} |
| 17 | |
| 18 | SessionID BrowserSyncedTabDelegate::GetWindowId() const { |
Scott Violet | 5655874f | 2020-01-14 21:03:21 | [diff] [blame] | 19 | return sessions::SessionTabHelper::FromWebContents(web_contents()) |
| 20 | ->window_id(); |
Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | SessionID BrowserSyncedTabDelegate::GetSessionId() const { |
Scott Violet | 5655874f | 2020-01-14 21:03:21 | [diff] [blame] | 24 | return sessions::SessionTabHelper::FromWebContents(web_contents()) |
| 25 | ->session_id(); |
Mikel Astiz | ce816173 | 2018-06-18 11:08:48 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | bool BrowserSyncedTabDelegate::IsPlaceholderTab() const { |
| 29 | return false; |
| 30 | } |
François Doray | 4f51d5d | 2018-12-03 22:26:24 | [diff] [blame] | 31 | |
Daniel Cheng | 383df85 | 2021-10-02 03:28:01 | [diff] [blame] | 32 | WEB_CONTENTS_USER_DATA_KEY_IMPL(BrowserSyncedTabDelegate); |