| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/script_bubble_view.h" | 5 #include "chrome/browser/ui/views/script_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 layout->AddPaddingRow(0, kPaddingBetweenRows); | 179 layout->AddPaddingRow(0, kPaddingBetweenRows); |
| 180 height_ += kPaddingBetweenRows; | 180 height_ += kPaddingBetweenRows; |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 layout->Layout(this); | 184 layout->Layout(this); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ScriptBubbleView::OnImageLoaded(size_t index, | 187 void ScriptBubbleView::OnImageLoaded(size_t index, |
| 188 const gfx::Image& image) { | 188 const gfx::Image& image) { |
| 189 const gfx::ImageSkia* image_skia = image.ToImageSkia(); | 189 if (!image.IsEmpty()) { |
| 190 entries_[index].extension_imageview->SetImage(image_skia); | 190 const gfx::ImageSkia* image_skia = image.ToImageSkia(); |
| 191 entries_[index].extension_imageview->SetImage(image_skia); |
| 192 } |
| 191 } | 193 } |
| 192 | 194 |
| 193 ScriptBubbleController* ScriptBubbleView::GetScriptBubbleController() { | 195 ScriptBubbleController* ScriptBubbleView::GetScriptBubbleController() { |
| 194 extensions::TabHelper* extensions_tab_helper = | 196 extensions::TabHelper* extensions_tab_helper = |
| 195 extensions::TabHelper::FromWebContents(web_contents_); | 197 extensions::TabHelper::FromWebContents(web_contents_); |
| 196 return extensions_tab_helper->script_bubble_controller(); | 198 return extensions_tab_helper->script_bubble_controller(); |
| 197 } | 199 } |
| OLD | NEW |