Commit acae7e45 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox UI: Fix Cocoa crash caused by an overzealous NOTREACHED.

When MD Refresh flag is on, but MacViews was not on, we would hit this
NOTREACHED.

Hitting it has no negative consequence, so we are replacing it with a
base::DoNothing.

Bug: 847646
Change-Id: Icc3b9ee24ef3e268960112013e79d05413683f46
Reviewed-on: https://chromium-review.googlesource.com/1079634Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562975}
parent 79f37043
......@@ -5,6 +5,7 @@
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#import "base/mac/mac_util.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
......@@ -84,11 +85,6 @@ const int kMinURLWidth = 120;
// SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF);
const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
void NotReached(const gfx::Image& image) {
// Mac Cocoa version should not receive asynchronously delivered favicons.
NOTREACHED();
}
} // namespace
// TODO(shess): This code is mostly copied from the gtk
......@@ -464,8 +460,10 @@ void LocationBarViewMac::UpdateLocationIcon() {
image_skia = gfx::CreateVectorIcon(toolbar::kHttpsValidIcon,
kDefaultIconSize, vector_icon_color);
} else {
// The view may return an icon asynchronously when certain flags are on,
// but the Cocoa implementation should just ignore them.
image_skia = omnibox_view_->GetIcon(kDefaultIconSize, vector_icon_color,
base::BindOnce(&NotReached));
base::DoNothing());
}
NSImage* image = NSImageFromImageSkiaWithColorSpace(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment