| 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/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" |
| 11 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 11 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 12 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 12 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 13 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 13 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 14 #include "chrome/browser/ui/webui/web_ui_util.h" | 14 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "content/browser/webui/web_ui.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 void TabToValue(const TabRestoreService::Tab& tab, | 21 void TabToValue(const TabRestoreService::Tab& tab, |
| 21 DictionaryValue* dictionary) { | 22 DictionaryValue* dictionary) { |
| 22 const TabNavigation& current_navigation = | 23 const TabNavigation& current_navigation = |
| 23 tab.navigations.at(tab.current_navigation_index); | 24 tab.navigations.at(tab.current_navigation_index); |
| 24 NewTabUI::SetURLTitleAndDirection(dictionary, current_navigation.title(), | 25 NewTabUI::SetURLTitleAndDirection(dictionary, current_navigation.title(), |
| 25 current_navigation.virtual_url()); | 26 current_navigation.virtual_url()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 DCHECK_EQ(entry->type, TabRestoreService::WINDOW); | 140 DCHECK_EQ(entry->type, TabRestoreService::WINDOW); |
| 140 WindowToValue(*static_cast<TabRestoreService::Window*>(entry), | 141 WindowToValue(*static_cast<TabRestoreService::Window*>(entry), |
| 141 entry_dict.get()); | 142 entry_dict.get()); |
| 142 } | 143 } |
| 143 | 144 |
| 144 entry_dict->SetInteger("sessionId", entry->id); | 145 entry_dict->SetInteger("sessionId", entry->id); |
| 145 entry_list_value->Append(entry_dict.release()); | 146 entry_list_value->Append(entry_dict.release()); |
| 146 added_count++; | 147 added_count++; |
| 147 } | 148 } |
| 148 } | 149 } |
| OLD | NEW |