diff options
| author | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 10:31:38 +0000 |
|---|---|---|
| committer | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 10:31:38 +0000 |
| commit | f9e806a80c91edca0e4be636b2b1ac5ad11334f6 (patch) | |
| tree | de418575f8d77a5c4ee4dfa804d07ae884c49fa9 | |
| parent | 7344c80bf52884bb335e903b17e98dc31cef51d7 (diff) | |
| download | chromium_src-f9e806a80c91edca0e4be636b2b1ac5ad11334f6.zip chromium_src-f9e806a80c91edca0e4be636b2b1ac5ad11334f6.tar.gz chromium_src-f9e806a80c91edca0e4be636b2b1ac5ad11334f6.tar.bz2 | |
Merge 84973 - Crashing and hanging of Page info bubble fixed
BUG=chromium-os:13858
TEST=manual
Review URL: http://codereview.chromium.org/6932043
TBR=glotov@google.com
Review URL: http://codereview.chromium.org/6969033
git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@85117 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | chrome/browser/ui/views/page_info_bubble_view.cc | 12 | ||||
| -rw-r--r-- | chrome/browser/ui/views/page_info_bubble_view.h | 7 |
2 files changed, 14 insertions, 5 deletions
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc index c895db0..17c0ba0 100644 --- a/chrome/browser/ui/views/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info_bubble_view.cc @@ -82,6 +82,8 @@ class Section : public views::View, //////////////////////////////////////////////////////////////////////////////// // PageInfoBubbleView +Bubble* PageInfoBubbleView::bubble_ = NULL; + PageInfoBubbleView::PageInfoBubbleView(gfx::NativeWindow parent_window, Profile* profile, const GURL& url, @@ -91,10 +93,11 @@ PageInfoBubbleView::PageInfoBubbleView(gfx::NativeWindow parent_window, show_history, this)), parent_window_(parent_window), cert_id_(ssl.cert_id()), - bubble_(NULL), help_center_link_(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)), animation_start_height_(0) { + if (bubble_) + bubble_->Close(); if (cert_id_ > 0) { scoped_refptr<net::X509Certificate> cert; CertStore::GetInstance()->RetrieveCert(cert_id_, &cert); @@ -207,6 +210,11 @@ void PageInfoBubbleView::ModelChanged() { resize_animation_.Show(); } +void PageInfoBubbleView::BubbleClosing(Bubble* bubble, bool closed_by_escape) { + resize_animation_.Reset(); + bubble_ = NULL; +} + bool PageInfoBubbleView::CloseOnEscape() { return true; } @@ -360,7 +368,7 @@ void ShowPageInfoBubble(gfx::NativeWindow parent, bounds.set_origin(point); bounds.set_width(kIconHorizontalOffset); - // Show the bubble. + // Show the bubble. If the bubble already exist - it will be closed first. PageInfoBubbleView* page_info_bubble = new PageInfoBubbleView(parent, profile, url, ssl, show_history); Bubble* bubble = diff --git a/chrome/browser/ui/views/page_info_bubble_view.h b/chrome/browser/ui/views/page_info_bubble_view.h index 47b05b6..bd09f8d 100644 --- a/chrome/browser/ui/views/page_info_bubble_view.h +++ b/chrome/browser/ui/views/page_info_bubble_view.h @@ -42,7 +42,7 @@ class PageInfoBubbleView : public views::View, virtual void ModelChanged(); // BubbleDelegate methods: - virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) {} + virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape); virtual bool CloseOnEscape(); virtual bool FadeInOnShow(); virtual std::wstring accessible_name(); @@ -58,6 +58,9 @@ class PageInfoBubbleView : public views::View, // Layout the sections within the bubble. void LayoutSections(); + // Global pointer to the bubble that is hosting our view. + static Bubble* bubble_; + // The model providing the various section info. PageInfoModel model_; @@ -67,8 +70,6 @@ class PageInfoBubbleView : public views::View, // The id of the certificate for this page. int cert_id_; - Bubble* bubble_; - // The Help Center link at the bottom of the bubble. views::Link* help_center_link_; |
