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

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

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 SetIcon(index_in_menu, image); 605 SetIcon(index_in_menu, image);
606 return; 606 return;
607 } 607 }
608 } 608 }
609 609
610 // Otherwise, start to fetch the favicon from local history asynchronously. 610 // Otherwise, start to fetch the favicon from local history asynchronously.
611 // Set default icon first. 611 // Set default icon first.
612 SetIcon(index_in_menu, default_favicon_); 612 SetIcon(index_in_menu, default_favicon_);
613 // Start request to fetch actual icon if possible. 613 // Start request to fetch actual icon if possible.
614 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 614 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
615 browser_->profile(), Profile::EXPLICIT_ACCESS); 615 browser_->profile(), ServiceAccessType::EXPLICIT_ACCESS);
616 if (!favicon_service) 616 if (!favicon_service)
617 return; 617 return;
618 618
619 favicon_service->GetFaviconImageForPageURL( 619 favicon_service->GetFaviconImageForPageURL(
620 url, 620 url,
621 base::Bind(&RecentTabsSubMenuModel::OnFaviconDataAvailable, 621 base::Bind(&RecentTabsSubMenuModel::OnFaviconDataAvailable,
622 weak_ptr_factory_.GetWeakPtr(), 622 weak_ptr_factory_.GetWeakPtr(),
623 command_id), 623 command_id),
624 is_local_tab ? &local_tab_cancelable_task_tracker_ 624 is_local_tab ? &local_tab_cancelable_task_tracker_
625 : &other_devices_tab_cancelable_task_tracker_); 625 : &other_devices_tab_cancelable_task_tracker_);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 687
688 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); 688 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate();
689 if (menu_model_delegate) 689 if (menu_model_delegate)
690 menu_model_delegate->OnMenuStructureChanged(); 690 menu_model_delegate->OnMenuStructureChanged();
691 } 691 }
692 692
693 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( 693 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed(
694 TabRestoreService* service) { 694 TabRestoreService* service) {
695 TabRestoreServiceChanged(service); 695 TabRestoreServiceChanged(service);
696 } 696 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc ('k') | chrome/browser/ui/views/frame/test_with_browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698