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

Unified Diff: chrome/browser/ui/color_chooser.h

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed comment Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
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..4f79343b342a1e7ab9363363929d4b4c1a22e90c
--- /dev/null
+++ b/chrome/browser/ui/color_chooser.h
@@ -0,0 +1,34 @@
+// 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 "third_party/WebKit/Source/WebKit/chromium/public/platform/WebColor.h"
+#include "ui/gfx/native_widget_types.h"
+
+class RenderViewHost;
+
+// 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;
Peter Kasting 2012/01/27 18:27:15 Don't use WebKit:: types in Chrome code. Use SkCo
keishi 2012/02/06 15:01:57 Done.
+ virtual void DidEnd() = 0;
+ virtual RenderViewHost* GetRenderViewHost() = 0;
+ };
+
+ static ColorChooser* Create();
Peter Kasting 2012/01/27 18:27:15 Why not have this function take a listener, instea
keishi 2012/02/06 15:01:57 Done.
+ virtual ~ColorChooser() {}
+
+ virtual void Open(Listener* listener, WebKit::WebColor initial_color) = 0;
+ virtual void End(Listener* listener) = 0;
+ virtual void SetSelectedColor(WebKit::WebColor color) = 0;
+};
+
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_H_

Powered by Google App Engine
This is Rietveld 408576698