OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ | |
6 #define CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ | |
7 #pragma once | |
8 | |
9 #if defined(ENABLE_INPUT_COLOR) | |
10 | |
11 #include "chrome/browser/ui/shell_dialogs.h" | |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" | |
13 #include "ui/gfx/native_widget_types.h" | |
14 | |
15 // Gtk and Mac use ColorChooser. Windows uses ColorChooserDialog instead | |
yosin_UTC9
2011/12/06 07:31:50
This comment may be:
This class wraps Windows's c
| |
16 // becuase it is not a singleton and it needs to inherit BaseShellDialog. | |
17 class ColorChooserDialog | |
18 : public base::RefCountedThreadSafe<ColorChooserDialog>, | |
19 public BaseShellDialog { | |
20 public: | |
21 // An interface implemented by a Listener object wishing to know about the | |
22 // the results from the color chooser dialog. | |
23 class Listener { | |
24 public: | |
25 virtual void DidChooseColor(WebKit::WebColor color) = 0; | |
26 }; | |
27 | |
28 // Creates a dialog box helper. This object is ref-counted, but the returned | |
29 // object will have no reference (refcount is 0). | |
30 static ColorChooserDialog* Create(Listener* listener); | |
yosin_UTC9
2011/12/06 07:31:50
It is better to have private ctor since this class
| |
31 | |
32 // Opens the color chooser dialog. | |
33 virtual void SelectColor(WebKit::WebColor initial_color, | |
34 gfx::NativeWindow owning_window) = 0; | |
35 }; | |
yosin_UTC9
2011/12/06 07:31:50
Please put
DISALLOW_COPY_AND_ASSIGN(ColorChooserDi
| |
36 | |
37 #endif // defined(ENABLE_INPUT_COLOR) | |
38 | |
39 #endif // CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ | |
40 | |
OLD | NEW |