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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 819623003: Add more checks to ShowPageActionPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9be31772fe3b03f571e1213f59b86495cf007f51..2e95b9066e82941211d03c2c5136372522eb3204 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -184,7 +184,8 @@ LocationBarView::LocationBarView(Browser* browser,
starting_omnibox_leading_inset_(0),
current_omnibox_leading_inset_(0),
current_omnibox_width_(0),
- ending_omnibox_width_(0) {
+ ending_omnibox_width_(0),
+ web_contents_null_at_last_refresh_(true) {
edit_bookmarks_enabled_.Init(
bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(),
base::Bind(&LocationBarView::Update, base::Unretained(this),
@@ -1078,6 +1079,7 @@ bool LocationBarView::RefreshPageActionViews() {
extensions_tab_helper->location_bar_controller();
new_page_actions = controller->GetCurrentActions();
}
+ web_contents_null_at_last_refresh_ = web_contents == NULL;
// On startup we sometimes haven't loaded any extensions. This makes sure
// we catch up when the extensions (and any page actions) load.
@@ -1315,7 +1317,12 @@ bool LocationBarView::ShowPageActionPopup(
CHECK(extension_action);
PageActionWithBadgeView* page_action_view =
GetPageActionView(extension_action);
- CHECK(page_action_view);
+ if (!page_action_view) {
+ CHECK(!web_contents_null_at_last_refresh_);
+ CHECK(!is_popup_mode_);
+ CHECK(!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled());
+ CHECK(false);
+ }
PageActionImageView* page_action_image_view = page_action_view->image_view();
CHECK(page_action_image_view);
ExtensionActionViewController* extension_action_view_controller =
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698