| 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 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 // ImageLoadingDone). | 1154 // ImageLoadingDone). |
| 1155 } | 1155 } |
| 1156 ~ImageLoadingTracker() {} | 1156 ~ImageLoadingTracker() {} |
| 1157 | 1157 |
| 1158 void StopTrackingImageLoad() { | 1158 void StopTrackingImageLoad() { |
| 1159 view_ = NULL; | 1159 view_ = NULL; |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 void OnImageLoaded(SkBitmap* image, int index) { | 1162 void OnImageLoaded(SkBitmap* image, int index) { |
| 1163 if (image == NULL) { | 1163 if (image == NULL) { |
| 1164 NOTREACHED(); | 1164 NOTREACHED() << "Image failed to decode."; |
| 1165 image = new SkBitmap(); | 1165 image = new SkBitmap(); |
| 1166 } | 1166 } |
| 1167 if (view_) | 1167 if (view_) |
| 1168 view_->OnImageLoaded(image, index); | 1168 view_->OnImageLoaded(image, index); |
| 1169 delete image; | 1169 delete image; |
| 1170 if (--image_count_ == 0) | 1170 if (--image_count_ == 0) |
| 1171 Release(); // We are no longer needed. | 1171 Release(); // We are no longer needed. |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 private: | 1174 private: |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 int LocationBarView::PageActionVisibleCount() { | 1383 int LocationBarView::PageActionVisibleCount() { |
| 1384 int result = 0; | 1384 int result = 0; |
| 1385 for (size_t i = 0; i < page_action_image_views_.size(); i++) { | 1385 for (size_t i = 0; i < page_action_image_views_.size(); i++) { |
| 1386 if (page_action_image_views_[i]->IsVisible()) | 1386 if (page_action_image_views_[i]->IsVisible()) |
| 1387 ++result; | 1387 ++result; |
| 1388 } | 1388 } |
| 1389 return result; | 1389 return result; |
| 1390 } | 1390 } |
| OLD | NEW |