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

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

Issue 1330423003: [Extensions Toolbar] Protect against crazy bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: chrome/browser/ui/toolbar/wrench_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 625359402eed4d5f58e83ab2bd64939c0aca0cb5..4aaec548828ee847f5eeaa5955c0af5c45bb5ca6 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -36,7 +36,7 @@
#include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h"
#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
#include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
-#include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
+#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -966,7 +966,9 @@ bool WrenchMenuModel::AddGlobalErrorMenuItems() {
void WrenchMenuModel::CreateActionToolbarOverflowMenu() {
// We only add the extensions overflow container if there are any icons that
// aren't shown in the main container.
- if (!ToolbarActionsModel::Get(browser_->profile())->all_icons_visible()) {
+ // browser_->window() can return null during startup.
+ if (browser_->window() &&
+ browser_->window()->GetToolbarActionsBar()->NeedsOverflow()) {
#if defined(OS_MACOSX)
// There's a bug in AppKit menus, where if a menu item with a custom view
// (like the extensions overflow menu) is the first menu item, it is not

Powered by Google App Engine
This is Rietveld 408576698