OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 Extension* extension = profile->GetExtensionsService()->GetExtensionById( | 688 Extension* extension = profile->GetExtensionsService()->GetExtensionById( |
689 page_action->extension_id()); | 689 page_action->extension_id()); |
690 DCHECK(extension); | 690 DCHECK(extension); |
691 | 691 |
692 DCHECK(!page_action->icon_paths().empty()); | 692 DCHECK(!page_action->icon_paths().empty()); |
693 const std::vector<std::string>& icon_paths = page_action->icon_paths(); | 693 const std::vector<std::string>& icon_paths = page_action->icon_paths(); |
694 pixbufs_.resize(icon_paths.size()); | 694 pixbufs_.resize(icon_paths.size()); |
695 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); | 695 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); |
696 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); | 696 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); |
697 iter != icon_paths.end(); ++iter) { | 697 iter != icon_paths.end(); ++iter) { |
698 tracker_->PostLoadImageTask(extension->GetResourcePath(*iter)); | 698 tracker_->PostLoadImageTask(extension->GetResource(*iter)); |
699 } | 699 } |
700 } | 700 } |
701 | 701 |
702 LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() { | 702 LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() { |
703 if (tracker_) | 703 if (tracker_) |
704 tracker_->StopTrackingImageLoad(); | 704 tracker_->StopTrackingImageLoad(); |
705 image_.Destroy(); | 705 image_.Destroy(); |
706 event_box_.Destroy(); | 706 event_box_.Destroy(); |
707 for (size_t i = 0; i < pixbufs_.size(); ++i) { | 707 for (size_t i = 0; i < pixbufs_.size(); ++i) { |
708 if (pixbufs_[i]) | 708 if (pixbufs_[i]) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 LocationBarViewGtk::PageActionViewGtk* page_action_view) { | 762 LocationBarViewGtk::PageActionViewGtk* page_action_view) { |
763 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( | 763 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( |
764 page_action_view->profile_, | 764 page_action_view->profile_, |
765 page_action_view->page_action_->extension_id(), | 765 page_action_view->page_action_->extension_id(), |
766 page_action_view->page_action_->id(), | 766 page_action_view->page_action_->id(), |
767 page_action_view->current_tab_id_, | 767 page_action_view->current_tab_id_, |
768 page_action_view->current_url_.spec(), | 768 page_action_view->current_url_.spec(), |
769 event->button); | 769 event->button); |
770 return true; | 770 return true; |
771 } | 771 } |
OLD | NEW |