Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Side by Side Diff: chrome/browser/ui/views/script_bubble_view.cc

Issue 11435002: Fix crash in Script Bubble View when images fail to load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698