From c74369a5288264e52355a940121cb09cebc633b5 Mon Sep 17 00:00:00 2001 From: "sky@google.com" Date: Mon, 15 Dec 2008 18:07:06 +0000 Subject: Changes the bookmark bubble to have the following logic: . We only apply edits when the bubble is closed (previously selecting a different folder resulted in an immediate action). . Hitting escape cancels any edits. . When the bubble is shown for newly bookmarked items hitting escape removes the bookmark. . If you click 'Edit...' or select 'Choose another folder...' any edits are applied immediately before the editor is shown. BUG=5015 TEST=thorougly test the bookmark bubble to make sure I haven't broken anything. Review URL: http://codereview.chromium.org/14074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6991 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/info_bubble.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'chrome/browser/views/info_bubble.h') diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 21a4e2d..4e918425 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -26,7 +26,10 @@ class Window; class InfoBubbleDelegate { public: // Called when the InfoBubble is closing and is about to be deleted. - virtual void InfoBubbleClosing(InfoBubble* info_bubble) = 0; + // |closed_by_escape| is true if the close is the result of the user pressing + // escape. + virtual void InfoBubbleClosing(InfoBubble* info_bubble, + bool closed_by_escape) = 0; // Whether the InfoBubble should be closed when the Esc key is pressed. virtual bool CloseOnEscape() = 0; @@ -148,6 +151,10 @@ class InfoBubble : public views::WidgetWin, virtual ContentView* CreateContentView(views::View* content); private: + // Closes the window notifying the delegate. |closed_by_escape| is true if + // the close is the result of pressing escape. + void Close(bool closed_by_escape); + // The delegate notified when the InfoBubble is closed. InfoBubbleDelegate* delegate_; @@ -160,8 +167,10 @@ class InfoBubble : public views::WidgetWin, // The fade-in animation. scoped_ptr fade_animation_; + // Have we been closed? + bool closed_; + DISALLOW_COPY_AND_ASSIGN(InfoBubble); }; #endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ - -- cgit v1.1