Index: chrome/browser/ui/color_chooser_dialog.h |
diff --git a/chrome/browser/ui/color_chooser_dialog.h b/chrome/browser/ui/color_chooser_dialog.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5a82158fafd4ef3e1d5567bb7bbd903b391162ec |
--- /dev/null |
+++ b/chrome/browser/ui/color_chooser_dialog.h |
@@ -0,0 +1,40 @@ |
+// Copyright (c) 2011 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. |
+ |
+#ifndef CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ |
+#define CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ |
+#pragma once |
+ |
+#if defined(ENABLE_INPUT_COLOR) |
+ |
+#include "chrome/browser/ui/shell_dialogs.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" |
+#include "ui/gfx/native_widget_types.h" |
+ |
+// 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
|
+// becuase it is not a singleton and it needs to inherit BaseShellDialog. |
+class ColorChooserDialog |
+ : public base::RefCountedThreadSafe<ColorChooserDialog>, |
+ public BaseShellDialog { |
+ public: |
+ // An interface implemented by a Listener object wishing to know about the |
+ // the results from the color chooser dialog. |
+ class Listener { |
+ public: |
+ virtual void DidChooseColor(WebKit::WebColor color) = 0; |
+ }; |
+ |
+ // Creates a dialog box helper. This object is ref-counted, but the returned |
+ // object will have no reference (refcount is 0). |
+ static ColorChooserDialog* Create(Listener* listener); |
yosin_UTC9
2011/12/06 07:31:50
It is better to have private ctor since this class
|
+ |
+ // Opens the color chooser dialog. |
+ virtual void SelectColor(WebKit::WebColor initial_color, |
+ gfx::NativeWindow owning_window) = 0; |
+}; |
yosin_UTC9
2011/12/06 07:31:50
Please put
DISALLOW_COPY_AND_ASSIGN(ColorChooserDi
|
+ |
+#endif // defined(ENABLE_INPUT_COLOR) |
+ |
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_ |
+ |