summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 06:21:54 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 06:21:54 +0000
commit998d3505508036a3408b2525f6107e6a1ba61481 (patch)
tree91760b462f34e2ff9b52a685b709f88723292bf6 /chrome
parentdf5883f0be0ec190be73e4ab148a521b4fa93275 (diff)
downloadchromium_src-998d3505508036a3408b2525f6107e6a1ba61481.zip
chromium_src-998d3505508036a3408b2525f6107e6a1ba61481.tar.gz
chromium_src-998d3505508036a3408b2525f6107e6a1ba61481.tar.bz2
Fix color chooser cleanup process.
- In case of crbug.com/139441, End() should close the window but it also schedules OnColorChooserDialogClosed() and this has been released already. That call isn't necessary in this case, so set_listener to NULL. - tab is expected to call DidEndColorChooser() everytime it ends, thus it should be called in End() too. the callback to prevent the calling BUG=139441 Review URL: https://chromiumcodereview.appspot.com/10821087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/views/color_chooser_aura.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/ui/views/color_chooser_aura.cc b/chrome/browser/ui/views/color_chooser_aura.cc
index 514c4b6..52f6a0a 100644
--- a/chrome/browser/ui/views/color_chooser_aura.cc
+++ b/chrome/browser/ui/views/color_chooser_aura.cc
@@ -47,6 +47,7 @@ ColorChooserAura::ColorChooserAura(int identifier,
SkColor initial_color)
: ColorChooser(identifier),
tab_(tab) {
+ DCHECK(tab_);
view_ = new views::ColorChooserView(this, initial_color);
widget_ = views::Widget::CreateWindow(view_);
widget_->SetAlwaysOnTop(true);
@@ -54,23 +55,24 @@ ColorChooserAura::ColorChooserAura(int identifier,
}
void ColorChooserAura::OnColorChosen(SkColor color) {
- if (tab_)
- tab_->DidChooseColorInColorChooser(identifier(), color);
+ tab_->DidChooseColorInColorChooser(identifier(), color);
}
void ColorChooserAura::OnColorChooserDialogClosed() {
- if (tab_)
- tab_->DidEndColorChooser(identifier());
view_ = NULL;
widget_ = NULL;
+ tab_->DidEndColorChooser(identifier());
}
void ColorChooserAura::End() {
if (widget_ && widget_->IsVisible()) {
+ view_->set_listener(NULL);
widget_->Close();
- tab_ = NULL;
view_ = NULL;
widget_ = NULL;
+ // DidEndColorChooser will invoke Browser::DidEndColorChooser, which deletes
+ // this. Take care of the call order.
+ tab_->DidEndColorChooser(identifier());
}
}