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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.h

Issue 7796010: Attempt at fixing crash in menus shown from infobars. Here's what the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ignore return value Created 9 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/views/infobars/infobar_view.h
diff --git a/chrome/browser/ui/views/infobars/infobar_view.h b/chrome/browser/ui/views/infobars/infobar_view.h
index 75d87605cd3c9759f3cd7eee27308905f8322ab4..1917881ecdcf85637607b26aaeb32e3c6263ff60 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.h
+++ b/chrome/browser/ui/views/infobars/infobar_view.h
@@ -12,8 +12,12 @@
#include "chrome/browser/tab_contents/infobar_container.h"
#include "third_party/skia/include/core/SkPath.h"
#include "views/controls/button/button.h"
+#include "views/controls/menu/menu_item_view.h"
#include "views/focus/focus_manager.h"
+namespace ui {
+class MenuModel;
+}
namespace views {
class ExternalFocusTracker;
class ImageButton;
@@ -22,6 +26,7 @@ class Label;
class Link;
class LinkListener;
class MenuButton;
+class MenuRunner;
class TextButton;
class ViewMenuDelegate;
}
@@ -83,6 +88,12 @@ class InfoBarView : public InfoBar,
// Convenience getter.
const InfoBarContainer::Delegate* container_delegate() const;
+ // Show a menu at the specified position. By invoking this InfobarView ensures
+ // the menu is destroyed at the appropriate time.
+ void RunMenuAt(ui::MenuModel* menu_model,
+ views::MenuButton* button,
+ views::MenuItemView::AnchorPosition anchor);
+
private:
static const int kHorizontalPadding;
@@ -115,6 +126,9 @@ class InfoBarView : public InfoBar,
SkPath fill_path_;
SkPath stroke_path_;
+ // Used to run the menu.
+ scoped_ptr<views::MenuRunner> menu_runner_;
+
DISALLOW_COPY_AND_ASSIGN(InfoBarView);
};

Powered by Google App Engine
This is Rietveld 408576698