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

Side by Side Diff: chrome/browser/ui/views/color_chooser_dialog.cc

Issue 24138002: Merge 220639 "ColorChooserWin::End should act like the dialog ha..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1599/src/
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/color_chooser_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/color_chooser_dialog.h" 5 #include "chrome/browser/ui/views/color_chooser_dialog.h"
6 6
7 #include <commdlg.h> 7 #include <commdlg.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool success = !!ChooseColor(&cc); 61 bool success = !!ChooseColor(&cc);
62 DisableOwner(cc.hwndOwner); 62 DisableOwner(cc.hwndOwner);
63 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 63 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
64 base::Bind(&ColorChooserDialog::DidCloseDialog, this, success, 64 base::Bind(&ColorChooserDialog::DidCloseDialog, this, success,
65 skia::COLORREFToSkColor(cc.rgbResult), params.run_state)); 65 skia::COLORREFToSkColor(cc.rgbResult), params.run_state));
66 } 66 }
67 67
68 void ColorChooserDialog::DidCloseDialog(bool chose_color, 68 void ColorChooserDialog::DidCloseDialog(bool chose_color,
69 SkColor color, 69 SkColor color,
70 RunState run_state) { 70 RunState run_state) {
71 if (!listener_)
72 return;
73 EndRun(run_state); 71 EndRun(run_state);
74 CopyCustomColors(custom_colors_, g_custom_colors); 72 CopyCustomColors(custom_colors_, g_custom_colors);
75 if (chose_color) 73 if (listener_) {
76 listener_->OnColorChosen(color); 74 if (chose_color)
77 listener_->OnColorChooserDialogClosed(); 75 listener_->OnColorChosen(color);
76 listener_->OnColorChooserDialogClosed();
77 }
78 } 78 }
79 79
80 void ColorChooserDialog::CopyCustomColors(COLORREF* src, COLORREF* dst) { 80 void ColorChooserDialog::CopyCustomColors(COLORREF* src, COLORREF* dst) {
81 memcpy(dst, src, sizeof(COLORREF) * arraysize(g_custom_colors)); 81 memcpy(dst, src, sizeof(COLORREF) * arraysize(g_custom_colors));
82 } 82 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/color_chooser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698