Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
index 0c3f0e03892b268c66955b69bbdc2f91b23b30aa..bd09811cc5b87a45a7c0f0ead1f949dca157fa9c 100644 |
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
@@ -10,6 +10,7 @@ |
#include "chrome/browser/ui/browser_finder.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
+#include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" |
#include "chrome/browser/ui/views/frame/browser_view.h" |
#include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
#include "chrome/browser/ui/views/passwords/manage_password_item_view.h" |
@@ -75,6 +76,23 @@ class SavePasswordRefusalComboboxModel : public ui::ComboboxModel { |
} // namespace |
+// Globals -------------------------------------------------------------------- |
+ |
+namespace chrome { |
+ |
+void ShowManagePasswordsBubble(content::WebContents* web_contents) { |
+ ManagePasswordsBubbleUIController* controller = |
+ ManagePasswordsBubbleUIController::FromWebContents(web_contents); |
+ ManagePasswordsBubbleView::ShowBubble( |
+ web_contents, |
+ controller->manage_passwords_bubble_needs_showing() ? |
+ ManagePasswordsBubbleView::AUTOMATIC : |
+ ManagePasswordsBubbleView::USER_ACTION); |
+} |
+ |
+} // namespace chrome |
+ |
+ |
// ManagePasswordsBubbleView -------------------------------------------------- |
// static |
@@ -141,7 +159,19 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView( |
set_notify_enter_exit_on_child(true); |
} |
-ManagePasswordsBubbleView::~ManagePasswordsBubbleView() {} |
+ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { |
+ // The combobox doesn't take ownership of it's model. If we created a combobox |
vabr (Chromium)
2014/04/30 07:56:07
The explanation in the comment is very helpful.
Ho
|
+ // we need to ensure that we delete the model here, and because the combobox |
+ // uses the model in it's destructor, we need to make sure we delete the model |
+ // _after_ the combobox itself is deleted. |
+ if (refuse_combobox_) { |
+ SavePasswordRefusalComboboxModel* model = |
+ static_cast<SavePasswordRefusalComboboxModel*>( |
+ refuse_combobox_->model()); |
+ delete refuse_combobox_; |
+ delete model; |
+ } |
+} |
void ManagePasswordsBubbleView::BuildColumnSet(views::GridLayout* layout, |
ColumnSetType type) { |