| 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/views/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 | 1197 |
| 1198 // Load the images this view needs asynchronously on the file thread. We'll | 1198 // Load the images this view needs asynchronously on the file thread. We'll |
| 1199 // get a call back into OnImageLoaded if the image loads successfully. If not, | 1199 // get a call back into OnImageLoaded if the image loads successfully. If not, |
| 1200 // the ImageView will have no image and will not appear in the Omnibox. | 1200 // the ImageView will have no image and will not appear in the Omnibox. |
| 1201 DCHECK(!page_action->icon_paths().empty()); | 1201 DCHECK(!page_action->icon_paths().empty()); |
| 1202 const std::vector<std::string>& icon_paths = page_action->icon_paths(); | 1202 const std::vector<std::string>& icon_paths = page_action->icon_paths(); |
| 1203 page_action_icons_.resize(icon_paths.size()); | 1203 page_action_icons_.resize(icon_paths.size()); |
| 1204 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); | 1204 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); |
| 1205 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); | 1205 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); |
| 1206 iter != icon_paths.end(); ++iter) { | 1206 iter != icon_paths.end(); ++iter) { |
| 1207 FilePath path = extension->GetResourcePath(*iter); | 1207 tracker_->PostLoadImageTask(extension->GetResource(*iter)); |
| 1208 tracker_->PostLoadImageTask(path); | |
| 1209 } | 1208 } |
| 1210 } | 1209 } |
| 1211 | 1210 |
| 1212 LocationBarView::PageActionImageView::~PageActionImageView() { | 1211 LocationBarView::PageActionImageView::~PageActionImageView() { |
| 1213 if (tracker_) | 1212 if (tracker_) |
| 1214 tracker_->StopTrackingImageLoad(); | 1213 tracker_->StopTrackingImageLoad(); |
| 1215 } | 1214 } |
| 1216 | 1215 |
| 1217 bool LocationBarView::PageActionImageView::OnMousePressed( | 1216 bool LocationBarView::PageActionImageView::OnMousePressed( |
| 1218 const views::MouseEvent& event) { | 1217 const views::MouseEvent& event) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 } | 1317 } |
| 1319 | 1318 |
| 1320 int LocationBarView::PageActionVisibleCount() { | 1319 int LocationBarView::PageActionVisibleCount() { |
| 1321 int result = 0; | 1320 int result = 0; |
| 1322 for (size_t i = 0; i < page_action_image_views_.size(); i++) { | 1321 for (size_t i = 0; i < page_action_image_views_.size(); i++) { |
| 1323 if (page_action_image_views_[i]->IsVisible()) | 1322 if (page_action_image_views_[i]->IsVisible()) |
| 1324 ++result; | 1323 ++result; |
| 1325 } | 1324 } |
| 1326 return result; | 1325 return result; |
| 1327 } | 1326 } |
| OLD | NEW |