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

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: Change comment and remove change to views 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..193bd1ed3633e44838747a9b0d92d70a53fca1a2 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.h
+++ b/chrome/browser/ui/views/infobars/infobar_view.h
@@ -12,8 +12,13 @@
#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/controls/menu/menu_runner.h"
#include "views/focus/focus_manager.h"
+namespace ui {
+class MenuModel;
+}
namespace views {
class ExternalFocusTracker;
class ImageButton;
@@ -83,6 +88,13 @@ 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.
+ views::MenuRunner::RunResult RunMenuAt(
+ ui::MenuModel* menu_model,
+ views::MenuButton* button,
+ views::MenuItemView::AnchorPosition anchor) WARN_UNUSED_RESULT;
+
private:
static const int kHorizontalPadding;
@@ -115,6 +127,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