| Index: chrome/browser/sessions/session_restore.cc
 | 
| ===================================================================
 | 
| --- chrome/browser/sessions/session_restore.cc	(revision 42688)
 | 
| +++ chrome/browser/sessions/session_restore.cc	(working copy)
 | 
| @@ -1,4 +1,4 @@
 | 
| -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
 | 
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 | 
|  // Use of this source code is governed by a BSD-style license that can be
 | 
|  // found in the LICENSE file.
 | 
|  
 | 
| @@ -26,6 +26,9 @@
 | 
|  #include "chrome/common/notification_registrar.h"
 | 
|  #include "chrome/common/notification_service.h"
 | 
|  
 | 
| +// Are we in the process of restoring?
 | 
| +static bool restoring = false;
 | 
| +
 | 
|  namespace {
 | 
|  
 | 
|  // TabLoader ------------------------------------------------------------------
 | 
| @@ -211,6 +214,7 @@
 | 
|  
 | 
|    ~SessionRestoreImpl() {
 | 
|      STLDeleteElements(&windows_);
 | 
| +    restoring = false;
 | 
|    }
 | 
|  
 | 
|    virtual void Observe(NotificationType type,
 | 
| @@ -502,6 +506,7 @@
 | 
|      NOTREACHED();
 | 
|      return;
 | 
|    }
 | 
| +  restoring = true;
 | 
|    profile->set_restored_last_session(true);
 | 
|    // SessionRestoreImpl takes care of deleting itself when done.
 | 
|    SessionRestoreImpl* restorer =
 | 
| @@ -527,3 +532,8 @@
 | 
|      const std::vector<GURL>& urls_to_open) {
 | 
|    Restore(profile, NULL, true, false, true, urls_to_open);
 | 
|  }
 | 
| +
 | 
| +// static
 | 
| +bool SessionRestore::IsRestoring() {
 | 
| +  return restoring;
 | 
| +}
 | 
| 
 |