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/gfx/gtk_util.h" | 9 #include "app/gfx/gtk_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 Extension* extension = profile->GetExtensionsService()->GetExtensionById( | 689 Extension* extension = profile->GetExtensionsService()->GetExtensionById( |
690 page_action->extension_id()); | 690 page_action->extension_id()); |
691 DCHECK(extension); | 691 DCHECK(extension); |
692 | 692 |
693 DCHECK(!page_action->icon_paths().empty()); | 693 DCHECK(!page_action->icon_paths().empty()); |
694 const std::vector<std::string>& icon_paths = page_action->icon_paths(); | 694 const std::vector<std::string>& icon_paths = page_action->icon_paths(); |
695 pixbufs_.resize(icon_paths.size()); | 695 pixbufs_.resize(icon_paths.size()); |
696 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); | 696 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); |
697 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); | 697 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); |
698 iter != icon_paths.end(); ++iter) { | 698 iter != icon_paths.end(); ++iter) { |
699 tracker_->PostLoadImageTask(extension->GetResource(*iter)); | 699 tracker_->PostLoadImageTask( |
| 700 extension->GetResource(*iter), |
| 701 gfx::Size(Extension::kPageActionIconMaxSize, |
| 702 Extension::kPageActionIconMaxSize)); |
700 } | 703 } |
701 } | 704 } |
702 | 705 |
703 LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() { | 706 LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() { |
704 if (tracker_) | 707 if (tracker_) |
705 tracker_->StopTrackingImageLoad(); | 708 tracker_->StopTrackingImageLoad(); |
706 image_.Destroy(); | 709 image_.Destroy(); |
707 event_box_.Destroy(); | 710 event_box_.Destroy(); |
708 for (size_t i = 0; i < pixbufs_.size(); ++i) { | 711 for (size_t i = 0; i < pixbufs_.size(); ++i) { |
709 if (pixbufs_[i]) | 712 if (pixbufs_[i]) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 LocationBarViewGtk::PageActionViewGtk* page_action_view) { | 766 LocationBarViewGtk::PageActionViewGtk* page_action_view) { |
764 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( | 767 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( |
765 page_action_view->profile_, | 768 page_action_view->profile_, |
766 page_action_view->page_action_->extension_id(), | 769 page_action_view->page_action_->extension_id(), |
767 page_action_view->page_action_->id(), | 770 page_action_view->page_action_->id(), |
768 page_action_view->current_tab_id_, | 771 page_action_view->current_tab_id_, |
769 page_action_view->current_url_.spec(), | 772 page_action_view->current_url_.spec(), |
770 event->button); | 773 event->button); |
771 return true; | 774 return true; |
772 } | 775 } |
OLD | NEW |