| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "app/animation.h" | 11 #include "app/animation.h" |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 | 1299 |
| 1300 if (tab_restore_service_) | 1300 if (tab_restore_service_) |
| 1301 TabRestoreServiceChanged(tab_restore_service_); | 1301 TabRestoreServiceChanged(tab_restore_service_); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void RecentlyClosedTabsHandler::TabRestoreServiceChanged( | 1304 void RecentlyClosedTabsHandler::TabRestoreServiceChanged( |
| 1305 TabRestoreService* service) { | 1305 TabRestoreService* service) { |
| 1306 const TabRestoreService::Entries& entries = service->entries(); | 1306 const TabRestoreService::Entries& entries = service->entries(); |
| 1307 ListValue list_value; | 1307 ListValue list_value; |
| 1308 int added_count = 0; | 1308 int added_count = 0; |
| 1309 const int max_count = NewTabUI::UseOldNewTabPage() ? 3 : 6; | 1309 const int max_count = NewTabUI::UseOldNewTabPage() ? 3 : 10; |
| 1310 | 1310 |
| 1311 // We filter the list of recently closed to only show 'interesting' entries, | 1311 // We filter the list of recently closed to only show 'interesting' entries, |
| 1312 // where an interesting entry is either a closed window or a closed tab | 1312 // where an interesting entry is either a closed window or a closed tab |
| 1313 // whose selected navigation is not the new tab ui. | 1313 // whose selected navigation is not the new tab ui. |
| 1314 for (TabRestoreService::Entries::const_iterator it = entries.begin(); | 1314 for (TabRestoreService::Entries::const_iterator it = entries.begin(); |
| 1315 it != entries.end() && added_count < max_count; ++it) { | 1315 it != entries.end() && added_count < max_count; ++it) { |
| 1316 TabRestoreService::Entry* entry = *it; | 1316 TabRestoreService::Entry* entry = *it; |
| 1317 DictionaryValue* value = new DictionaryValue(); | 1317 DictionaryValue* value = new DictionaryValue(); |
| 1318 if ((entry->type == TabRestoreService::TAB && | 1318 if ((entry->type == TabRestoreService::TAB && |
| 1319 TabToValue(*static_cast<TabRestoreService::Tab*>(entry), value)) || | 1319 TabToValue(*static_cast<TabRestoreService::Tab*>(entry), value)) || |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 bool NewTabUI::WebResourcesEnabled() { | 1601 bool NewTabUI::WebResourcesEnabled() { |
| 1602 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1602 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1603 return command_line->HasSwitch(switches::kEnableWebResources); | 1603 return command_line->HasSwitch(switches::kEnableWebResources); |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 // static | 1606 // static |
| 1607 bool NewTabUI::FirstRunDisabled() { | 1607 bool NewTabUI::FirstRunDisabled() { |
| 1608 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1608 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1609 return command_line->HasSwitch(switches::kDisableNewTabFirstRun); | 1609 return command_line->HasSwitch(switches::kDisableNewTabFirstRun); |
| 1610 } | 1610 } |
| OLD | NEW |