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

Unified Diff: chrome/browser/views/location_bar_view.h

Issue 399032: Fix a crash when activating a select element inside a page action (Closed)
Patch Set: Only allow one popup at a time Created 11 years, 1 month 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/views/location_bar_view.h
diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h
index 3a57e261a34b1258cf9172edc8bb8480f5ad6dfc..91ca81bb5a5b7f6f3336f3256b4b5b86f4068199 100644
--- a/chrome/browser/views/location_bar_view.h
+++ b/chrome/browser/views/location_bar_view.h
@@ -11,11 +11,13 @@
#include "app/gfx/font.h"
#include "base/gfx/rect.h"
+#include "base/task.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/toolbar_model.h"
+#include "chrome/browser/views/browser_bubble.h"
#include "chrome/browser/views/info_bubble.h"
#include "views/controls/image_view.h"
#include "views/controls/label.h"
@@ -31,6 +33,7 @@
class BubblePositioner;
class CommandUpdater;
class ExtensionAction;
+class ExtensionPopup;
class GURL;
class Profile;
@@ -359,7 +362,8 @@ class LocationBarView : public LocationBar,
// PageActionImageView is used to display the icon for a given PageAction
// and notify the extension when the icon is clicked.
class PageActionImageView : public LocationBarImageView,
- public ImageLoadingTracker::Observer {
+ public ImageLoadingTracker::Observer,
+ public BrowserBubble::Delegate {
public:
PageActionImageView(LocationBarView* owner,
Profile* profile,
@@ -385,6 +389,10 @@ class LocationBarView : public LocationBar,
// Overridden from ImageLoadingTracker.
virtual void OnImageLoaded(SkBitmap* image, size_t index);
+ // Overridden from BrowserBubble::Delegate
+ virtual void BubbleBrowserWindowClosing(BrowserBubble* bubble);
+ virtual void BubbleLostFocus(BrowserBubble* bubble);
+
// Called to notify the PageAction that it should determine whether to be
// visible or hidden. |contents| is the TabContents that is active, |url|
// is the current page URL.
@@ -394,6 +402,9 @@ class LocationBarView : public LocationBar,
void ExecuteAction(int button);
private:
+ // Hides the active popup, if there is one.
+ void HidePopup();
+
// The location bar view that owns us.
LocationBarView* owner_;
@@ -425,6 +436,11 @@ class LocationBarView : public LocationBar,
// is briefly shown even if it hasn't been enabled by it's extension.
bool preview_enabled_;
+ // The current popup and the button it came from. NULL if no popup.
+ ExtensionPopup* popup_;
+
+ ScopedRunnableMethodFactory<PageActionImageView> method_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PageActionImageView);
};
friend class PageActionImageView;

Powered by Google App Engine
This is Rietveld 408576698