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

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

Issue 330603004: Rename FaviconBitmapXxx to FaviconRawBitmapXxx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 606
607 // Otherwise, start to fetch the favicon from local history asynchronously. 607 // Otherwise, start to fetch the favicon from local history asynchronously.
608 // Set default icon first. 608 // Set default icon first.
609 SetIcon(index_in_menu, default_favicon_); 609 SetIcon(index_in_menu, default_favicon_);
610 // Start request to fetch actual icon if possible. 610 // Start request to fetch actual icon if possible.
611 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 611 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
612 browser_->profile(), Profile::EXPLICIT_ACCESS); 612 browser_->profile(), Profile::EXPLICIT_ACCESS);
613 if (!favicon_service) 613 if (!favicon_service)
614 return; 614 return;
615 615
616 favicon_service->GetFaviconImageForURL( 616 favicon_service->GetFaviconImageForPageURL(
617 FaviconService::FaviconForURLParams( 617 FaviconService::FaviconForPageURLParams(
618 url, favicon_base::FAVICON, gfx::kFaviconSize), 618 url, favicon_base::FAVICON, gfx::kFaviconSize),
619 base::Bind(&RecentTabsSubMenuModel::OnFaviconDataAvailable, 619 base::Bind(&RecentTabsSubMenuModel::OnFaviconDataAvailable,
620 weak_ptr_factory_.GetWeakPtr(), 620 weak_ptr_factory_.GetWeakPtr(),
621 command_id), 621 command_id),
622 is_local_tab ? &local_tab_cancelable_task_tracker_ 622 is_local_tab ? &local_tab_cancelable_task_tracker_
623 : &other_devices_tab_cancelable_task_tracker_); 623 : &other_devices_tab_cancelable_task_tracker_);
624 } 624 }
625 625
626 void RecentTabsSubMenuModel::OnFaviconDataAvailable( 626 void RecentTabsSubMenuModel::OnFaviconDataAvailable(
627 int command_id, 627 int command_id,
(...skipping 18 matching lines...) Expand all
646 } 646 }
647 *tab_items = &local_tab_navigation_items_; 647 *tab_items = &local_tab_navigation_items_;
648 return command_id - kFirstLocalTabCommandId; 648 return command_id - kFirstLocalTabCommandId;
649 } 649 }
650 650
651 void RecentTabsSubMenuModel::ClearLocalEntries() { 651 void RecentTabsSubMenuModel::ClearLocalEntries() {
652 // Remove local items (recently closed tabs and windows) from menumodel. 652 // Remove local items (recently closed tabs and windows) from menumodel.
653 while (last_local_model_index_ >= 0) 653 while (last_local_model_index_ >= 0)
654 RemoveItemAt(last_local_model_index_--); 654 RemoveItemAt(last_local_model_index_--);
655 655
656 // Cancel asynchronous FaviconService::GetFaviconImageForURL() tasks of all 656 // Cancel asynchronous FaviconService::GetFaviconImageForPageURL() tasks of
657 // all
657 // local tabs. 658 // local tabs.
658 local_tab_cancelable_task_tracker_.TryCancelAll(); 659 local_tab_cancelable_task_tracker_.TryCancelAll();
659 660
660 // Remove all local tab navigation items. 661 // Remove all local tab navigation items.
661 local_tab_navigation_items_.clear(); 662 local_tab_navigation_items_.clear();
662 663
663 // Remove all local window items. 664 // Remove all local window items.
664 local_window_items_.clear(); 665 local_window_items_.clear();
665 } 666 }
666 667
(...skipping 17 matching lines...) Expand all
684 685
685 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); 686 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate();
686 if (menu_model_delegate) 687 if (menu_model_delegate)
687 menu_model_delegate->OnMenuStructureChanged(); 688 menu_model_delegate->OnMenuStructureChanged();
688 } 689 }
689 690
690 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( 691 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed(
691 TabRestoreService* service) { 692 TabRestoreService* service) {
692 TabRestoreServiceChanged(service); 693 TabRestoreServiceChanged(service);
693 } 694 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698