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

Side by Side Diff: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS Created 5 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
« no previous file with comments | « chrome/browser/ui/singleton_tabs.cc ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/toolbar/recent_tabs_sub_menu_model.h" 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // recent, independent of which window the tabs were from. 486 // recent, independent of which window the tabs were from.
487 std::vector<const sessions::SessionTab*> tabs_in_session; 487 std::vector<const sessions::SessionTab*> tabs_in_session;
488 for (size_t j = 0; j < windows.size(); ++j) { 488 for (size_t j = 0; j < windows.size(); ++j) {
489 const sessions::SessionWindow* window = windows[j]; 489 const sessions::SessionWindow* window = windows[j];
490 for (size_t t = 0; t < window->tabs.size(); ++t) { 490 for (size_t t = 0; t < window->tabs.size(); ++t) {
491 const sessions::SessionTab* tab = window->tabs[t]; 491 const sessions::SessionTab* tab = window->tabs[t];
492 if (tab->navigations.empty()) 492 if (tab->navigations.empty())
493 continue; 493 continue;
494 const sessions::SerializedNavigationEntry& current_navigation = 494 const sessions::SerializedNavigationEntry& current_navigation =
495 tab->navigations.at(tab->normalized_navigation_index()); 495 tab->navigations.at(tab->normalized_navigation_index());
496 if (chrome::IsNTPURL(current_navigation.virtual_url(), 496 if (search::IsNTPURL(current_navigation.virtual_url(),
497 browser_->profile())) { 497 browser_->profile())) {
498 continue; 498 continue;
499 } 499 }
500 tabs_in_session.push_back(tab); 500 tabs_in_session.push_back(tab);
501 } 501 }
502 } 502 }
503 if (tabs_in_session.empty()) 503 if (tabs_in_session.empty())
504 continue; 504 continue;
505 std::sort(tabs_in_session.begin(), tabs_in_session.end(), 505 std::sort(tabs_in_session.begin(), tabs_in_session.end(),
506 SortTabsByRecency); 506 SortTabsByRecency);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 703
704 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); 704 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate();
705 if (menu_model_delegate) 705 if (menu_model_delegate)
706 menu_model_delegate->OnMenuStructureChanged(); 706 menu_model_delegate->OnMenuStructureChanged();
707 } 707 }
708 708
709 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( 709 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed(
710 TabRestoreService* service) { 710 TabRestoreService* service) {
711 TabRestoreServiceChanged(service); 711 TabRestoreServiceChanged(service);
712 } 712 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/singleton_tabs.cc ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698