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..0f88948151ea3be46067a6bcab06f290eaa6c518 |
--- /dev/null |
+++ b/chrome/browser/ui/color_chooser.h |
@@ -0,0 +1,35 @@ |
+// 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 |
+ |
+#include "base/memory/singleton.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/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 DidEnd() = 0; |
+ }; |
+ |
+ // Returns singleton instance of ColorChooser. |
Peter Kasting
2012/01/17 20:53:10
This seems wrong -- why can't multiple tabs ask fo
keishi
2012/01/27 04:34:08
Multiple tabs could ask for color choosers but the
|
+ static ColorChooser* GetInstance(); |
+ |
+ virtual void open(Listener* listener, WebKit::WebColor initial_color) = 0; |
Peter Kasting
2012/01/17 20:53:10
Use Chrome-style function names, not WebKit-style.
keishi
2012/01/27 04:34:08
Done.
|
+ virtual void end(Listener* listener) = 0; |
+ virtual void setSelectedColor(WebKit::WebColor color) = 0; |
+ |
+ protected: |
+ virtual ~ColorChooser() {} |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_H_ |