| 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/sessions/session_id.h" | 5 #include "chrome/browser/sessions/session_id.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sessions/restore_tab_helper.h" | 7 #include "chrome/browser/sessions/session_tab_helper.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 9 | 9 |
| 10 static SessionID::id_type next_id = 1; | 10 static SessionID::id_type next_id = 1; |
| 11 | 11 |
| 12 SessionID::SessionID() { | 12 SessionID::SessionID() { |
| 13 id_ = next_id++; | 13 id_ = next_id++; |
| 14 } | 14 } |
| 15 | 15 |
| 16 SessionID::id_type SessionID::IdForTab(const TabContents* tab) { | 16 SessionID::id_type SessionID::IdForTab(const TabContents* tab) { |
| 17 return tab ? tab->restore_tab_helper()->session_id().id() : -1; | 17 return tab ? tab->session_tab_helper()->session_id().id() : -1; |
| 18 } | 18 } |
| 19 | 19 |
| 20 SessionID::id_type SessionID::IdForWindowContainingTab(const TabContents* tab) { | 20 SessionID::id_type SessionID::IdForWindowContainingTab(const TabContents* tab) { |
| 21 return tab ? tab->restore_tab_helper()->window_id().id() : -1; | 21 return tab ? tab->session_tab_helper()->window_id().id() : -1; |
| 22 } | 22 } |
| OLD | NEW |