Chromium Code Reviews| 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" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 int pending_index = web_contents->GetController().GetPendingEntryIndex(); | 41 int pending_index = web_contents->GetController().GetPendingEntryIndex(); |
| 42 return (pending_index == i) | 42 return (pending_index == i) |
| 43 ? web_contents->GetController().GetPendingEntry() | 43 ? web_contents->GetController().GetPendingEntry() |
| 44 : web_contents->GetController().GetEntryAtIndex(i); | 44 : web_contents->GetController().GetEntryAtIndex(i); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 TabContentsSyncedTabDelegate::TabContentsSyncedTabDelegate( | 49 TabContentsSyncedTabDelegate::TabContentsSyncedTabDelegate( |
| 50 content::WebContents* web_contents) | 50 content::WebContents* web_contents) |
| 51 : web_contents_(web_contents), sync_session_id_(0) {} | 51 : web_contents_(web_contents), sync_session_id_(-1) {} |
|
Ted C
2017/04/18 04:53:49
should -1 be TabNodePool::kInvalidTabNodeID?
Nicolas Zea
2017/04/18 05:04:11
Done.
| |
| 52 | 52 |
| 53 TabContentsSyncedTabDelegate::~TabContentsSyncedTabDelegate() {} | 53 TabContentsSyncedTabDelegate::~TabContentsSyncedTabDelegate() {} |
| 54 | 54 |
| 55 SessionID::id_type TabContentsSyncedTabDelegate::GetWindowId() const { | 55 SessionID::id_type TabContentsSyncedTabDelegate::GetWindowId() const { |
| 56 return SessionTabHelper::FromWebContents(web_contents_)->window_id().id(); | 56 return SessionTabHelper::FromWebContents(web_contents_)->window_id().id(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 SessionID::id_type TabContentsSyncedTabDelegate::GetSessionId() const { | 59 SessionID::id_type TabContentsSyncedTabDelegate::GetSessionId() const { |
| 60 return SessionTabHelper::FromWebContents(web_contents_)->session_id().id(); | 60 return SessionTabHelper::FromWebContents(web_contents_)->session_id().id(); |
| 61 } | 61 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 } | 172 } |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 SessionID::id_type TabContentsSyncedTabDelegate::GetSourceTabID() const { | 176 SessionID::id_type TabContentsSyncedTabDelegate::GetSourceTabID() const { |
| 177 sync_sessions::SyncSessionsRouterTabHelper* helper = | 177 sync_sessions::SyncSessionsRouterTabHelper* helper = |
| 178 sync_sessions::SyncSessionsRouterTabHelper::FromWebContents( | 178 sync_sessions::SyncSessionsRouterTabHelper::FromWebContents( |
| 179 web_contents_); | 179 web_contents_); |
| 180 return helper->source_tab_id(); | 180 return helper->source_tab_id(); |
| 181 } | 181 } |
| OLD | NEW |