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

Unified Diff: chrome/browser/ui/color_chooser_dialog.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_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..10f7825b3842f30b998862997301341da4a65df5
--- /dev/null
+++ b/chrome/browser/ui/color_chooser_dialog.h
@@ -0,0 +1,39 @@
+// 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
+
+#include "chrome/browser/ui/base_shell_dialog.h"
+#include "base/memory/ref_counted.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebColor.h"
+
+// Shows a dialog for choosing color.
+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;
+ virtual void DidEnd() = 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);
+
+ // Opens the color chooser dialog.
+ virtual void SelectColor(WebKit::WebColor initial_color,
+ gfx::NativeWindow owning_window) = 0;
+
+ explicit ColorChooserDialog() { }
+
+ DISALLOW_COPY_AND_ASSIGN(ColorChooserDialog);
+};
+
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_

Powered by Google App Engine
This is Rietveld 408576698