Index: chrome/browser/ui/color_chooser.h |
diff --git a/chrome/browser/ui/color_chooser.h b/chrome/browser/ui/color_chooser.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..87fc661c86122cb796c25ff5461268cdfb5a20f7 |
--- /dev/null |
+++ b/chrome/browser/ui/color_chooser.h |
@@ -0,0 +1,42 @@ |
+// 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_H_ |
+#define CHROME_BROWSER_UI_COLOR_CHOOSER_H_ |
+#pragma once |
+ |
+#if defined(ENABLE_INPUT_COLOR) |
+ |
+#include "base/memory/singleton.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" |
+#include "ui/gfx/native_widget_types.h" |
+ |
+// Abstraction object for color choosers of each platforms. |
+class ColorChooser { |
+ public: |
+ // An interface implemented by a Listener object wishing to know about the |
+ // the results from the color chooser. |
+ class Listener { |
+ public: |
+ virtual void DidChooseColor(WebKit::WebColor color) = 0; |
+ virtual void DidCleanup() = 0; |
+ }; |
+ |
+ // Returns singleton instance of ColorChooserImpl. |
+ static ColorChooser* GetInstance(); |
+ |
+ void open(Listener* listener, WebKit::WebColor initial_color); |
+ void cleanup(Listener* listener); |
+ void setSelectedColor(WebKit::WebColor color); |
+ |
+ protected: |
+ virtual ~ColorChooser(); |
+ virtual void openImpl(Listener* listener, WebKit::WebColor initial_color) = 0; |
+ virtual void cleanupImpl(Listener* listener) = 0; |
+ virtual void setSelectedColorImpl(WebKit::WebColor color) = 0; |
+}; |
+ |
+#endif // defined(ENABLE_INPUT_COLOR) |
+ |
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_H_ |