summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:45:08 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:45:08 +0000
commitd53f41fdb39ef26a460c8e5784db07dee9600c9f (patch)
tree106221936822f8413767c982f164f0cc8e135abd /chrome/browser/gtk/browser_actions_toolbar_gtk.cc
parent990b3570337841be1c8eae8089132385cd86c6c3 (diff)
downloadchromium_src-d53f41fdb39ef26a460c8e5784db07dee9600c9f.zip
chromium_src-d53f41fdb39ef26a460c8e5784db07dee9600c9f.tar.gz
chromium_src-d53f41fdb39ef26a460c8e5784db07dee9600c9f.tar.bz2
Linux: fix crash on incognito opening extensions after reordering non-incognito browser action.
The std::map operator[] inserted default (NULL) pointer on not-found elements which later caused the crash. BUG=40498 TEST=see bug Review URL: http://codereview.chromium.org/1517025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_actions_toolbar_gtk.cc')
-rw-r--r--chrome/browser/gtk/browser_actions_toolbar_gtk.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
index d78b2f9..be26bb6 100644
--- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
@@ -547,8 +547,8 @@ void BrowserActionsToolbarGtk::BrowserActionMoved(Extension* extension,
if (drag_button_ != NULL)
return;
- BrowserActionButton* button = extension_button_map_[extension->id()].get();
- if (!button) {
+ GtkWidget* button_widget = GetBrowserActionWidget(extension);
+ if (!button_widget) {
if (ShouldDisplayBrowserAction(extension))
NOTREACHED();
return;
@@ -557,7 +557,7 @@ void BrowserActionsToolbarGtk::BrowserActionMoved(Extension* extension,
if (profile_->IsOffTheRecord())
index = model_->OriginalIndexToIncognito(index);
- gtk_box_reorder_child(GTK_BOX(button_hbox_.get()), button->widget(), index);
+ gtk_box_reorder_child(GTK_BOX(button_hbox_.get()), button_widget, index);
}
void BrowserActionsToolbarGtk::ModelLoaded() {