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

Unified Diff: chrome/browser/sessions/session_tab_helper.h

Issue 480883002: Move session_id.{cc,h} from chrome/browser/sessions to components/sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/session_tab_helper.h
diff --git a/chrome/browser/sessions/session_tab_helper.h b/chrome/browser/sessions/session_tab_helper.h
index 2fe66696dcf4d74fb0f23ae73d95e3bf70818c23..d47ec80c956852247d29a35f07f0bc7f0f45bb16 100644
--- a/chrome/browser/sessions/session_tab_helper.h
+++ b/chrome/browser/sessions/session_tab_helper.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
#include "base/basictypes.h"
-#include "chrome/browser/sessions/session_id.h"
+#include "components/sessions/session_id.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -24,6 +24,24 @@ class SessionTabHelper : public content::WebContentsObserver,
void SetWindowID(const SessionID& id);
const SessionID& window_id() const { return window_id_; }
+ // If the specified WebContents has a SessionTabHelper (probably because it
+ // was used as the contents of a tab), returns a tab id. This value is
+ // immutable for a given tab. It will be unique across Chrome within the
+ // current session, but may be re-used across sessions. Returns -1
+ // for a NULL WebContents or if the WebContents has no SessionTabHelper.
+ static SessionID::id_type IdForTab(const content::WebContents* tab);
+
+ // If the specified WebContents has a SessionTabHelper (probably because it
+ // was used as the contents of a tab), and has ever been attached to a Browser
+ // window, returns Browser::session_id().id() for that Browser. If the tab is
+ // being dragged between Browser windows, returns the old window's id value.
+ // If the WebContents has a SessionTabHelper but has never been attached to a
+ // Browser window, returns an id value that is different from that of any
+ // Browser. Returns -1 for a NULL WebContents or if the WebContents has no
+ // SessionTabHelper.
+ static SessionID::id_type IdForWindowContainingTab(
+ const content::WebContents* tab);
+
// content::WebContentsObserver:
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
« no previous file with comments | « chrome/browser/sessions/session_service_test_helper.cc ('k') | chrome/browser/sessions/session_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698