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

Side by Side Diff: chrome/browser/ui/gtk/global_history_menu.cc

Issue 53283004: Adding support for forced URLs to TopSites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed GetAllMostVisited. Created 7 years, 1 month 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
OLDNEW
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/gtk/global_history_menu.h" 5 #include "chrome/browser/ui/gtk/global_history_menu.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 content::Source<history::TopSites>(top_sites_)); 137 content::Source<history::TopSites>(top_sites_));
138 } 138 }
139 } 139 }
140 } 140 }
141 141
142 void GlobalHistoryMenu::GetTopSitesData() { 142 void GlobalHistoryMenu::GetTopSitesData() {
143 DCHECK(top_sites_); 143 DCHECK(top_sites_);
144 144
145 top_sites_->GetMostVisitedURLs( 145 top_sites_->GetMostVisitedURLs(
146 base::Bind(&GlobalHistoryMenu::OnTopSitesReceived, 146 base::Bind(&GlobalHistoryMenu::OnTopSitesReceived,
147 weak_ptr_factory_.GetWeakPtr())); 147 weak_ptr_factory_.GetWeakPtr()), false);
148 } 148 }
149 149
150 void GlobalHistoryMenu::OnTopSitesReceived( 150 void GlobalHistoryMenu::OnTopSitesReceived(
151 const history::MostVisitedURLList& visited_list) { 151 const history::MostVisitedURLList& visited_list) {
152 ClearMenuSection(history_menu_, GlobalMenuBar::TAG_MOST_VISITED); 152 ClearMenuSection(history_menu_, GlobalMenuBar::TAG_MOST_VISITED);
153 153
154 int index = GetIndexOfMenuItemWithTag( 154 int index = GetIndexOfMenuItemWithTag(
155 history_menu_, 155 history_menu_,
156 GlobalMenuBar::TAG_MOST_VISITED_HEADER) + 1; 156 GlobalMenuBar::TAG_MOST_VISITED_HEADER) + 1;
157 157
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 tab_restore_service_->LoadTabsFromLastSession(); 409 tab_restore_service_->LoadTabsFromLastSession();
410 tab_restore_service_->AddObserver(this); 410 tab_restore_service_->AddObserver(this);
411 411
412 // If LoadTabsFromLastSession doesn't load tabs, it won't call 412 // If LoadTabsFromLastSession doesn't load tabs, it won't call
413 // TabRestoreServiceChanged(). This ensures that all new windows after 413 // TabRestoreServiceChanged(). This ensures that all new windows after
414 // the first one will have their menus populated correctly. 414 // the first one will have their menus populated correctly.
415 TabRestoreServiceChanged(tab_restore_service_); 415 TabRestoreServiceChanged(tab_restore_service_);
416 } 416 }
417 } 417 }
418 } 418 }
OLDNEW
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_service_unittest.cc ('k') | chrome/browser/ui/views/frame/global_menu_bar_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698