Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: chrome/browser/ui/views/color_chooser_win.cc

Issue 23785003: ColorChooserWin::End should act like the dialog has closed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed comment Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/color_chooser_dialog.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/color_chooser_win.cc
diff --git a/chrome/browser/ui/views/color_chooser_win.cc b/chrome/browser/ui/views/color_chooser_win.cc
index b895c5e2b6e621ecbf8460d00a3757cef85fea6b..38486aa7004016a0eddcb9930e9aba90fae89ae7 100644
--- a/chrome/browser/ui/views/color_chooser_win.cc
+++ b/chrome/browser/ui/views/color_chooser_win.cc
@@ -24,7 +24,7 @@ class ColorChooserWin : public content::ColorChooser,
~ColorChooserWin();
// content::ColorChooser overrides:
- virtual void End() OVERRIDE {}
+ virtual void End() OVERRIDE;
virtual void SetSelectedColor(SkColor color) OVERRIDE {}
// views::ColorChooserListener overrides:
@@ -66,6 +66,16 @@ ColorChooserWin::~ColorChooserWin() {
DCHECK(!color_chooser_dialog_);
}
+void ColorChooserWin::End() {
+ // While we can't programmatically close the dialog, we should at least have
+ // the dialog finalize state and inform listeners that it's closed, so that
+ // ColorChooserDialog::DidCloseDialog won't call the listener after it has
+ // been destroyed.
+ // If we don't do this we the ColorChooserDialog::DidCloseDialog will try to
+ // call the listener after it has been destroyed.
Peter Kasting 2013/08/30 19:35:47 Grammar issue and redundancy. Here's a cleanup at
keishi 2013/08/30 19:42:43 This is better. Thanks. Done.
+ OnColorChooserDialogClosed();
+}
+
void ColorChooserWin::OnColorChosen(SkColor color) {
if (web_contents_)
web_contents_->DidChooseColorInColorChooser(color);
« no previous file with comments | « chrome/browser/ui/views/color_chooser_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698