diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 21:18:04 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 21:18:04 +0000 |
commit | 1d880243e74f2e904c25417afae3eb1cd1f42d10 (patch) | |
tree | 6d88ea8c00cb6fa4582a26580457ca661101d686 | |
parent | b558ac1663de10c4bb601088c43e57a32004b0cb (diff) | |
download | chromium_src-1d880243e74f2e904c25417afae3eb1cd1f42d10.zip chromium_src-1d880243e74f2e904c25417afae3eb1cd1f42d10.tar.gz chromium_src-1d880243e74f2e904c25417afae3eb1cd1f42d10.tar.bz2 |
Fix 2 issues with incognito extensions on linux:
- Drag and drop of browser actions wouldn't work properly from an incognito
window.
- Installing an extension from an incognito window raised a DCHECK.
Review URL: http://codereview.chromium.org/983004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41764 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/browser_actions_toolbar_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/extension_installed_bubble_gtk.cc | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc index 4e2aa8a..7a9ecdf 100644 --- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc @@ -582,8 +582,6 @@ gboolean BrowserActionsToolbarGtk::OnDragMotion(GtkWidget* widget, return FALSE; drop_index_ = x < kButtonSize ? 0 : x / (kButtonSize + kButtonPadding); - if (profile_->IsOffTheRecord()) - drop_index_ = model_->IncognitoIndexToOriginal(drop_index_); // We will go ahead and reorder the child in order to provide visual feedback // to the user. We don't inform the model that it has moved until the drag @@ -597,8 +595,12 @@ gboolean BrowserActionsToolbarGtk::OnDragMotion(GtkWidget* widget, void BrowserActionsToolbarGtk::OnDragEnd(GtkWidget* button, GdkDragContext* drag_context) { - if (drop_index_ != -1) + if (drop_index_ != -1) { + if (profile_->IsOffTheRecord()) + drop_index_ = model_->IncognitoIndexToOriginal(drop_index_); + model_->MoveBrowserAction(drag_button_->extension(), drop_index_); + } drag_button_ = NULL; drop_index_ = -1; diff --git a/chrome/browser/gtk/extension_installed_bubble_gtk.cc b/chrome/browser/gtk/extension_installed_bubble_gtk.cc index 784c45a..1ab5d1d 100644 --- a/chrome/browser/gtk/extension_installed_bubble_gtk.cc +++ b/chrome/browser/gtk/extension_installed_bubble_gtk.cc @@ -94,7 +94,10 @@ void ExtensionInstalledBubbleGtk::ShowInternal() { // its coordinates, so we force a check_resize here. gtk_container_check_resize(GTK_CONTAINER( browser_window->GetToolbar()->widget())); - DCHECK(reference_widget); + // If the widget is not visible then browser_window could be incognito + // with this extension disabled. Fall back to default position. + if (reference_widget && !GTK_WIDGET_VISIBLE(reference_widget)) + reference_widget = NULL; } else if (type_ == PAGE_ACTION) { LocationBarViewGtk* location_bar_view = browser_window->GetToolbar()->GetLocationBarView(); |