OLD | NEW |
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 #include "chrome/browser/sessions/tab_restore_service.h" | 5 #include "chrome/browser/sessions/tab_restore_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
27 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
28 #include "chrome/common/extensions/extension_constants.h" | 28 #include "chrome/common/extensions/extension_constants.h" |
29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
30 #include "content/browser/tab_contents/navigation_controller.h" | 30 #include "content/browser/tab_contents/navigation_controller.h" |
31 #include "content/browser/tab_contents/tab_contents.h" | 31 #include "content/browser/tab_contents/tab_contents.h" |
32 #include "content/public/browser/navigation_entry.h" | 32 #include "content/public/browser/navigation_entry.h" |
33 | 33 |
34 using base::Time; | 34 using base::Time; |
35 using content::NavigationEntry; | 35 using content::NavigationEntry; |
| 36 using content::WebContents; |
36 | 37 |
37 // TimeFactory----------------------------------------------------------------- | 38 // TimeFactory----------------------------------------------------------------- |
38 | 39 |
39 TabRestoreService::TimeFactory::~TimeFactory() {} | 40 TabRestoreService::TimeFactory::~TimeFactory() {} |
40 | 41 |
41 // Entry ---------------------------------------------------------------------- | 42 // Entry ---------------------------------------------------------------------- |
42 | 43 |
43 // ID of the next Entry. | 44 // ID of the next Entry. |
44 static SessionID::id_type next_entry_id = 1; | 45 static SessionID::id_type next_entry_id = 1; |
45 | 46 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 (*tab_j).browser_id = delegate->GetSessionID().id(); | 397 (*tab_j).browser_id = delegate->GetSessionID().id(); |
397 } | 398 } |
398 } | 399 } |
399 break; | 400 break; |
400 } | 401 } |
401 } | 402 } |
402 } | 403 } |
403 delegate->ShowBrowserWindow(); | 404 delegate->ShowBrowserWindow(); |
404 | 405 |
405 if (disposition == CURRENT_TAB && current_delegate && | 406 if (disposition == CURRENT_TAB && current_delegate && |
406 current_delegate->GetSelectedTabContents()) { | 407 current_delegate->GetSelectedWebContents()) { |
407 current_delegate->CloseTab(); | 408 current_delegate->CloseTab(); |
408 } | 409 } |
409 } else { | 410 } else { |
410 NOTREACHED(); | 411 NOTREACHED(); |
411 } | 412 } |
412 | 413 |
413 if (!restoring_tab_in_window) { | 414 if (!restoring_tab_in_window) { |
414 delete entry; | 415 delete entry; |
415 } | 416 } |
416 | 417 |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 // the front, not the end and we just added the entries to the end). | 1166 // the front, not the end and we just added the entries to the end). |
1166 entries_to_write_ = staging_entries_.size(); | 1167 entries_to_write_ = staging_entries_.size(); |
1167 | 1168 |
1168 PruneEntries(); | 1169 PruneEntries(); |
1169 NotifyTabsChanged(); | 1170 NotifyTabsChanged(); |
1170 } | 1171 } |
1171 | 1172 |
1172 Time TabRestoreService::TimeNow() const { | 1173 Time TabRestoreService::TimeNow() const { |
1173 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); | 1174 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); |
1174 } | 1175 } |
OLD | NEW |