diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 04:25:45 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 04:25:45 +0000 |
commit | c6b207c6c4290a06000fabd9b09a96614d3ae118 (patch) | |
tree | 6c3f284de26c7a88415bba43f465e32282700d01 /chrome/browser/ui/global_error.cc | |
parent | 02eb89fb03a303cb2b745063e6d852feb3bc5c5e (diff) | |
download | chromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.zip chromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.tar.gz chromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.tar.bz2 |
Cocoa: Close bubble if its GlobalError object is removed
This is the Cocoa version of this change:
https://chromiumcodereview.appspot.com/9190009
BUG=109728
TEST=
Review URL: http://codereview.chromium.org/9254019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118994 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/global_error.cc')
-rw-r--r-- | chrome/browser/ui/global_error.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/ui/global_error.cc b/chrome/browser/ui/global_error.cc index f2cf17c..a282df7 100644 --- a/chrome/browser/ui/global_error.cc +++ b/chrome/browser/ui/global_error.cc @@ -1,14 +1,17 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/global_error.h" #include "base/logging.h" +#include "chrome/browser/ui/global_error_bubble_view_base.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" -GlobalError::GlobalError() : has_shown_bubble_view_(false) { +GlobalError::GlobalError() + : has_shown_bubble_view_(false), + bubble_view_(NULL) { } GlobalError::~GlobalError() { @@ -28,9 +31,20 @@ bool GlobalError::HasShownBubbleView() { void GlobalError::ShowBubbleView(Browser* browser) { has_shown_bubble_view_ = true; - ShowBubbleView(browser, this); + bubble_view_ = + GlobalErrorBubbleViewBase::ShowBubbleView(browser, AsWeakPtr()); +} + +GlobalErrorBubbleViewBase* GlobalError::GetBubbleView() { + return bubble_view_; } int GlobalError::GetBubbleViewIconResourceID() { return IDR_INPUT_ALERT; } + +void GlobalError::BubbleViewDidClose(Browser* browser) { + DCHECK(browser); + bubble_view_ = NULL; + OnBubbleViewDidClose(browser); +} |