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

Side by Side Diff: chrome/browser/sessions/session_tab_helper.h

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
6 #define CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_ 6 #define CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/browser/common/web_contents_user_data.h" 9 #include "chrome/browser/common/web_contents_user_data.h"
10 #include "chrome/browser/sessions/session_id.h" 10 #include "chrome/browser/sessions/session_id.h"
(...skipping 13 matching lines...) Expand all
24 void SetWindowID(const SessionID& id); 24 void SetWindowID(const SessionID& id);
25 const SessionID& window_id() const { return window_id_; } 25 const SessionID& window_id() const { return window_id_; }
26 26
27 // content::WebContentsObserver: 27 // content::WebContentsObserver:
28 virtual void RenderViewCreated( 28 virtual void RenderViewCreated(
29 content::RenderViewHost* render_view_host) OVERRIDE; 29 content::RenderViewHost* render_view_host) OVERRIDE;
30 virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE; 30 virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE;
31 31
32 private: 32 private:
33 explicit SessionTabHelper(content::WebContents* contents); 33 explicit SessionTabHelper(content::WebContents* contents);
34 static int kUserDataKey;
35 friend class WebContentsUserData<SessionTabHelper>; 34 friend class WebContentsUserData<SessionTabHelper>;
36 35
37 // Unique identifier of the tab for session restore. This id is only unique 36 // Unique identifier of the tab for session restore. This id is only unique
38 // within the current session, and is not guaranteed to be unique across 37 // within the current session, and is not guaranteed to be unique across
39 // sessions. 38 // sessions.
40 const SessionID session_id_; 39 const SessionID session_id_;
41 40
42 // Unique identifier of the window the tab is in. 41 // Unique identifier of the window the tab is in.
43 SessionID window_id_; 42 SessionID window_id_;
44 43
45 DISALLOW_COPY_AND_ASSIGN(SessionTabHelper); 44 DISALLOW_COPY_AND_ASSIGN(SessionTabHelper);
46 }; 45 };
47 46
48 #endif // CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_ 47 #endif // CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698