Home | History | Annotate | Download | only in sessions
      1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_ID_H_
      6 #define CHROME_BROWSER_SESSIONS_SESSION_ID_H_
      7 #pragma once
      8 
      9 #include "base/basictypes.h"
     10 
     11 class NavigationController;
     12 class SessionService;
     13 namespace browser_sync {
     14   class SessionModelAssociator;
     15 }
     16 
     17 // Uniquely identifies a tab or window for the duration of a session.
     18 class SessionID {
     19  public:
     20   typedef int32 id_type;
     21 
     22   SessionID();
     23   ~SessionID() {}
     24 
     25   // Returns the underlying id.
     26   id_type id() const { return id_; }
     27 
     28  private:
     29   friend class NavigationController;
     30   friend class SessionService;
     31   friend class browser_sync::SessionModelAssociator;
     32 
     33   explicit SessionID(id_type id) : id_(id) {}
     34 
     35   // Resets the id. This is used when restoring a session
     36   void set_id(id_type id) { id_ = id; }
     37 
     38   id_type id_;
     39 };
     40 
     41 #endif  // CHROME_BROWSER_SESSIONS_SESSION_ID_H_
     42