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

Side by Side Diff: chrome/browser/sessions/session_id.cc

Issue 10912156: Move SessionID, CaptureVisibleTabFunction to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase atop the extension tab helper change Created 8 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/session_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 content::WebContents* tab) {
17 return tab ? tab->session_tab_helper()->session_id().id() : -1; 17 const TabContents* tab_contents = tab ? TabContents::FromWebContents(tab)
18 : NULL;
19 return tab_contents ? tab_contents->session_tab_helper()->session_id().id()
20 : -1;
18 } 21 }
19 22
20 SessionID::id_type SessionID::IdForWindowContainingTab(const TabContents* tab) { 23 SessionID::id_type SessionID::IdForWindowContainingTab(
21 return tab ? tab->session_tab_helper()->window_id().id() : -1; 24 const content::WebContents* tab) {
25 const TabContents* tab_contents = tab ? TabContents::FromWebContents(tab)
26 : NULL;
27 return tab_contents ? tab_contents->session_tab_helper()->window_id().id()
28 : -1;
22 } 29 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_id.h ('k') | chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698