diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-28 00:41:27 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-28 00:41:27 +0000 |
commit | 5f2731c58384eb8b4b5102865dedbe9ade800d8a (patch) | |
tree | 77b8ff1862e478f7a22931c97047653a5cff90e0 /chrome/browser/views | |
parent | 4829cfadb745f47c441c709475e5f33a2b26d831 (diff) | |
download | chromium_src-5f2731c58384eb8b4b5102865dedbe9ade800d8a.zip chromium_src-5f2731c58384eb8b4b5102865dedbe9ade800d8a.tar.gz chromium_src-5f2731c58384eb8b4b5102865dedbe9ade800d8a.tar.bz2 |
Does two changes to appease chrome bot runs:
. Changes InfoBubble to properly initialize all fields in member
initializer list and set the delegate before show on the off chance
the bubble is deleted from show. This should no longer happen after
the second change.
. Only show the bookmark bubble if the browser window is active. I
experimented with conditionally enabling the star and this turns out
to be a bit error prone.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/31016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.h | 2 |
4 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index e1341f94..e8cb64a 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -525,6 +525,10 @@ void BrowserView::Activate() { frame_->GetWindow()->Activate(); } +bool BrowserView::IsActive() const { + return frame_->GetWindow()->IsActive(); +} + void BrowserView::FlashFrame() { FLASHWINFO fwi; fwi.cbSize = sizeof(fwi); diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index ebf4649..0de9e20 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -183,6 +183,7 @@ class BrowserView : public BrowserWindow, virtual void SetBounds(const gfx::Rect& bounds); virtual void Close(); virtual void Activate(); + virtual bool IsActive() const; virtual void FlashFrame(); virtual void* GetNativeHandle(); virtual BrowserWindowTesting* GetBrowserWindowTesting(); diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 042d908..3ab8ec0 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -73,12 +73,18 @@ InfoBubble* InfoBubble::Show(HWND parent_hwnd, InfoBubble* window = new InfoBubble(); DLOG(WARNING) << "new bubble=" << window; window->Init(parent_hwnd, position_relative_to, content); - window->ShowWindow(SW_SHOW); + // Set the delegate before we show, on the off chance the delegate is needed + // during showing. window->delegate_ = delegate; + window->ShowWindow(SW_SHOW); return window; } -InfoBubble::InfoBubble() : content_view_(NULL), closed_(false) { +InfoBubble::InfoBubble() + : delegate_(NULL), + parent_(NULL), + content_view_(NULL), + closed_(false) { } InfoBubble::~InfoBubble() { diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 4e918425..99d82c6 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -41,7 +41,7 @@ class InfoBubble : public views::WidgetWin, // Shows the InfoBubble. The InfoBubble is parented to parent_hwnd, contains // the View content and positioned relative to the screen position // position_relative_to. Show takes ownership of content and deletes the - // create InfoBubble when another window is activated. You can explicitly + // created InfoBubble when another window is activated. You can explicitly // close the bubble by invoking Close. A delegate may optionally be provided // to be notified when the InfoBubble is closed and to prevent the InfoBubble // from being closed when the Escape key is pressed (which is the default |