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

Unified Diff: chrome/browser/ui/toolbar/origin_chip_info.cc

Issue 291173008: [OriginChip] Don't crash for invalid extension URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/origin_chip_info.cc
diff --git a/chrome/browser/ui/toolbar/origin_chip_info.cc b/chrome/browser/ui/toolbar/origin_chip_info.cc
index 84572f9e5ab5f1bdeab5f4a58776a3cdb494b3c7..d062209643a41b3b48b99686f7bb0e6c07588049 100644
--- a/chrome/browser/ui/toolbar/origin_chip_info.cc
+++ b/chrome/browser/ui/toolbar/origin_chip_info.cc
@@ -111,12 +111,16 @@ bool OriginChipInfo::Update(const content::WebContents* web_contents,
label_);
}
- if (displayed_url_.SchemeIs(extensions::kExtensionScheme)) {
- icon_ = IDR_EXTENSIONS_FAVICON;
+ const extensions::Extension* extension = NULL;
- const extensions::Extension* extension =
+ if (displayed_url_.SchemeIs(extensions::kExtensionScheme)) {
+ extension =
extensions::ExtensionSystem::Get(profile_)->extension_service()->
extensions()->GetExtensionOrAppByURL(displayed_url_);
+ }
+
+ if (extension) {
+ icon_ = IDR_EXTENSIONS_FAVICON;
extension_icon_image_.reset(
Peter Kasting 2014/05/22 17:30:29 It seems like an even simpler change would have be
groby-ooo-7-16 2014/05/22 23:13:00 Done.
new extensions::IconImage(profile_,
extension,
« 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