| 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 // get deleted until we get a response from image loading (see | 1146 // get deleted until we get a response from image loading (see |
| 1147 // ImageLoadingDone). | 1147 // ImageLoadingDone). |
| 1148 } | 1148 } |
| 1149 ~ImageLoadingTracker() {} | 1149 ~ImageLoadingTracker() {} |
| 1150 | 1150 |
| 1151 void StopTrackingImageLoad() { | 1151 void StopTrackingImageLoad() { |
| 1152 view_ = NULL; | 1152 view_ = NULL; |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 void OnImageLoaded(SkBitmap* image, int index) { | 1155 void OnImageLoaded(SkBitmap* image, int index) { |
| 1156 if (image == NULL) | 1156 if (image == NULL) { |
| 1157 NOTREACHED(); |
| 1157 image = new SkBitmap(); | 1158 image = new SkBitmap(); |
| 1159 } |
| 1158 if (view_) | 1160 if (view_) |
| 1159 view_->OnImageLoaded(image, index); | 1161 view_->OnImageLoaded(image, index); |
| 1160 delete image; | 1162 delete image; |
| 1161 if (--image_count_ == 0) | 1163 if (--image_count_ == 0) |
| 1162 Release(); // We are no longer needed. | 1164 Release(); // We are no longer needed. |
| 1163 } | 1165 } |
| 1164 | 1166 |
| 1165 private: | 1167 private: |
| 1166 | 1168 |
| 1167 // The view that is waiting for the image to load. | 1169 // The view that is waiting for the image to load. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 } | 1374 } |
| 1373 | 1375 |
| 1374 int LocationBarView::PageActionVisibleCount() { | 1376 int LocationBarView::PageActionVisibleCount() { |
| 1375 int result = 0; | 1377 int result = 0; |
| 1376 for (size_t i = 0; i < page_action_image_views_.size(); i++) { | 1378 for (size_t i = 0; i < page_action_image_views_.size(); i++) { |
| 1377 if (page_action_image_views_[i]->IsVisible()) | 1379 if (page_action_image_views_[i]->IsVisible()) |
| 1378 ++result; | 1380 ++result; |
| 1379 } | 1381 } |
| 1380 return result; | 1382 return result; |
| 1381 } | 1383 } |
| OLD | NEW |