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

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 1167004: Adds the source ImageLoadingTracker to OnImageLoaded. I need this in a (Closed)
Patch Set: Created 10 years, 9 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar_view_mac.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/nsimage_cache_mac.h" 10 #include "base/nsimage_cache_mac.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 anchoredAt:arrowPoint 682 anchoredAt:arrowPoint
683 arrowLocation:kTopRight]; 683 arrowLocation:kTopRight];
684 } else { 684 } else {
685 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( 685 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted(
686 profile_, page_action_->extension_id(), page_action_->id(), 686 profile_, page_action_->extension_id(), page_action_->id(),
687 current_tab_id_, current_url_.spec(), 687 current_tab_id_, current_url_.spec(),
688 1); 688 1);
689 } 689 }
690 } 690 }
691 691
692 void LocationBarViewMac::PageActionImageView::OnImageLoaded(SkBitmap* image, 692 void LocationBarViewMac::PageActionImageView::OnImageLoaded(
693 size_t index) { 693 ImageLoadingTracker* source, SkBitmap* image, size_t index) {
694 // We loaded icons()->size() icons, plus one extra if the Page Action had 694 // We loaded icons()->size() icons, plus one extra if the Page Action had
695 // a default icon. 695 // a default icon.
696 int total_icons = page_action_->icon_paths()->size(); 696 int total_icons = page_action_->icon_paths()->size();
697 if (!page_action_->default_icon_path().empty()) 697 if (!page_action_->default_icon_path().empty())
698 total_icons++; 698 total_icons++;
699 DCHECK(static_cast<int>(index) < total_icons); 699 DCHECK(static_cast<int>(index) < total_icons);
700 700
701 // Map the index of the loaded image back to its name. If we ever get an 701 // Map the index of the loaded image back to its name. If we ever get an
702 // index greater than the number of icons, it must be the default icon. 702 // index greater than the number of icons, it must be the default icon.
703 if (image) { 703 if (image) {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 ++result; 951 ++result;
952 } 952 }
953 return result; 953 return result;
954 } 954 }
955 955
956 void LocationBarViewMac::PageActionViewList::OnMousePressed(NSRect iconFrame, 956 void LocationBarViewMac::PageActionViewList::OnMousePressed(NSRect iconFrame,
957 size_t index) { 957 size_t index) {
958 ViewAt(index)->OnMousePressed(iconFrame); 958 ViewAt(index)->OnMousePressed(iconFrame);
959 } 959 }
960 960
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/location_bar_view_mac.h ('k') | chrome/browser/extensions/image_loading_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698