Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: chrome/browser/dom_ui/new_tab_ui.cc

Issue 165148: Merge 22396 - Change the numbe of recently closed tabs to a maximum of 10 ins... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/dom_ui/new_tab_ui.cc:r22396
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698