OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/ntp/recently_closed_tabs_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // RestoreForeignSessionTab needs a SessionTab. | 90 // RestoreForeignSessionTab needs a SessionTab. |
91 SessionTab session_tab; | 91 SessionTab session_tab; |
92 session_tab.current_navigation_index = tab_entry->current_navigation_index; | 92 session_tab.current_navigation_index = tab_entry->current_navigation_index; |
93 session_tab.navigations = tab_entry->navigations; | 93 session_tab.navigations = tab_entry->navigations; |
94 | 94 |
95 SessionRestore::RestoreForeignSessionTab(web_ui()->GetWebContents(), | 95 SessionRestore::RestoreForeignSessionTab(web_ui()->GetWebContents(), |
96 session_tab, NEW_FOREGROUND_TAB); | 96 session_tab, NEW_FOREGROUND_TAB); |
97 #else | 97 #else |
98 TabRestoreServiceDelegate* delegate = | 98 TabRestoreServiceDelegate* delegate = |
99 TabRestoreServiceDelegate::FindDelegateForController( | 99 TabRestoreServiceDelegate::FindDelegateForWebContents( |
100 &web_ui()->GetWebContents()->GetController(), NULL); | 100 web_ui()->GetWebContents()); |
101 if (!delegate) | 101 if (!delegate) |
102 return; | 102 return; |
103 WindowOpenDisposition disposition = | 103 WindowOpenDisposition disposition = |
104 web_ui_util::GetDispositionFromClick(args, 2); | 104 web_ui_util::GetDispositionFromClick(args, 2); |
105 tab_restore_service_->RestoreEntryById(delegate, | 105 tab_restore_service_->RestoreEntryById(delegate, |
106 static_cast<int>(session_to_restore), | 106 static_cast<int>(session_to_restore), |
107 disposition); | 107 disposition); |
108 // The current tab has been nuked at this point; don't touch any member | 108 // The current tab has been nuked at this point; don't touch any member |
109 // variables. | 109 // variables. |
110 #endif | 110 #endif |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 DCHECK_EQ(entry->type, TabRestoreService::WINDOW); | 164 DCHECK_EQ(entry->type, TabRestoreService::WINDOW); |
165 WindowToValue(*static_cast<TabRestoreService::Window*>(entry), | 165 WindowToValue(*static_cast<TabRestoreService::Window*>(entry), |
166 entry_dict.get()); | 166 entry_dict.get()); |
167 } | 167 } |
168 | 168 |
169 entry_dict->SetInteger("sessionId", entry->id); | 169 entry_dict->SetInteger("sessionId", entry->id); |
170 entry_list_value->Append(entry_dict.release()); | 170 entry_list_value->Append(entry_dict.release()); |
171 added_count++; | 171 added_count++; |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |