| 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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 | 1191 |
| 1192 // Load the images this view needs asynchronously on the file thread. We'll | 1192 // Load the images this view needs asynchronously on the file thread. We'll |
| 1193 // get a call back into OnImageLoaded if the image loads successfully. If not, | 1193 // get a call back into OnImageLoaded if the image loads successfully. If not, |
| 1194 // the ImageView will have no image and will not appear in the Omnibox. | 1194 // the ImageView will have no image and will not appear in the Omnibox. |
| 1195 DCHECK(!page_action->icon_paths().empty()); | 1195 DCHECK(!page_action->icon_paths().empty()); |
| 1196 const std::vector<std::string>& icon_paths = page_action->icon_paths(); | 1196 const std::vector<std::string>& icon_paths = page_action->icon_paths(); |
| 1197 page_action_icons_.resize(icon_paths.size()); | 1197 page_action_icons_.resize(icon_paths.size()); |
| 1198 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); | 1198 tracker_ = new ImageLoadingTracker(this, icon_paths.size()); |
| 1199 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); | 1199 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); |
| 1200 iter != icon_paths.end(); ++iter) { | 1200 iter != icon_paths.end(); ++iter) { |
| 1201 tracker_->PostLoadImageTask(extension->GetResource(*iter)); | 1201 tracker_->PostLoadImageTask( |
| 1202 extension->GetResource(*iter), |
| 1203 gfx::Size(Extension::kPageActionIconMaxSize, |
| 1204 Extension::kPageActionIconMaxSize)); |
| 1202 } | 1205 } |
| 1203 } | 1206 } |
| 1204 | 1207 |
| 1205 LocationBarView::PageActionImageView::~PageActionImageView() { | 1208 LocationBarView::PageActionImageView::~PageActionImageView() { |
| 1206 if (tracker_) | 1209 if (tracker_) |
| 1207 tracker_->StopTrackingImageLoad(); | 1210 tracker_->StopTrackingImageLoad(); |
| 1208 } | 1211 } |
| 1209 | 1212 |
| 1210 bool LocationBarView::PageActionImageView::OnMousePressed( | 1213 bool LocationBarView::PageActionImageView::OnMousePressed( |
| 1211 const views::MouseEvent& event) { | 1214 const views::MouseEvent& event) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 } | 1314 } |
| 1312 | 1315 |
| 1313 int LocationBarView::PageActionVisibleCount() { | 1316 int LocationBarView::PageActionVisibleCount() { |
| 1314 int result = 0; | 1317 int result = 0; |
| 1315 for (size_t i = 0; i < page_action_image_views_.size(); i++) { | 1318 for (size_t i = 0; i < page_action_image_views_.size(); i++) { |
| 1316 if (page_action_image_views_[i]->IsVisible()) | 1319 if (page_action_image_views_[i]->IsVisible()) |
| 1317 ++result; | 1320 ++result; |
| 1318 } | 1321 } |
| 1319 return result; | 1322 return result; |
| 1320 } | 1323 } |
| OLD | NEW |