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

Unified Diff: content/public/browser/color_chooser.h

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased Created 8 years, 9 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
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/color_chooser.h
diff --git a/content/public/browser/color_chooser.h b/content/public/browser/color_chooser.h
new file mode 100644
index 0000000000000000000000000000000000000000..7519da59189b43ef995e3a2a37a989d105ae836d
--- /dev/null
+++ b/content/public/browser/color_chooser.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
+#define CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
+#pragma once
+
+#include "third_party/skia/include/core/SkColor.h"
+
+namespace content {
+
+class RenderViewHost;
+class WebContents;
+
+// Abstraction object for color choosers for each platform.
+class ColorChooser {
+ public:
+ static ColorChooser* Create(int identifier,
+ WebContents* tab,
+ SkColor initial_color);
+ ColorChooser(int identifier) : identifier_(identifier) {}
+ virtual ~ColorChooser() {}
+
+ // Returns a unique identifier for this chooser. Identifiers are unique
+ // across a renderer process. This avoids race conditions in synchronizing
+ // the browser and renderer processes. For example, if a renderer closes one
+ // chooser and opens another, and simultaneously the user picks a color in the
+ // first chooser, the IDs can be used to drop the "chose a color" message
+ // rather than erroneously tell the renderer that the user picked a color in
+ // the second chooser.
+ int identifier() const { return identifier_; }
+
+ // Ends connection with color chooser. Closes color chooser depending on the
+ // platform.
+ virtual void End() = 0;
+
+ // Sets the selected color.
+ virtual void SetSelectedColor(SkColor color) = 0;
+
+private:
+ int identifier_;
+};
+
+}
+
+#endif // CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698